fix: home page redirection logic (#752)

* fix: dashboard workspace activity mutation

* fix: home page redirection logic

* chore: add homePageRedirect function back
This commit is contained in:
Aaryan Khandelwal 2023-04-09 00:02:33 +05:30 committed by GitHub
parent 03e74415f2
commit 08e77cb19e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 72 additions and 14 deletions

View file

@ -3,6 +3,8 @@ import { useState } from "react";
import Image from "next/image";
import { useRouter } from "next/router";
import { mutate } from "swr";
// services
import userService from "services/user.service";
// hooks
@ -20,6 +22,8 @@ import { ONBOARDING_CARDS } from "constants/workspace";
import Logo from "public/onboarding/logo.svg";
// types
import type { NextPage } from "next";
// fetch-keys
import { CURRENT_USER } from "constants/fetch-keys";
const Onboarding: NextPage = () => {
const [step, setStep] = useState(1);
@ -72,6 +76,7 @@ const Onboarding: NextPage = () => {
userService
.updateUserOnBoard({ userRole })
.then(() => {
mutate(CURRENT_USER);
router.push("/");
})
.catch((err) => {