Add eslint rule and fix as many issues as possible

This commit is contained in:
Khoa Le
2023-06-19 23:42:04 -04:00
parent e9eacc445d
commit 9d33e4756b
689 changed files with 9446 additions and 21821 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { useEffect } from "react";
import { useRouter } from "next/router";
import getWorkspaces from './api/workspace/getWorkspaces';
import getWorkspaces from "./api/workspace/getWorkspaces";
export default function DashboardRedirect() {
const router = useRouter();
@@ -14,15 +14,15 @@ export default function DashboardRedirect() {
(async () => {
let userWorkspace;
try {
if (localStorage.getItem('projectData.id')) {
router.push(`/dashboard/${ localStorage.getItem('projectData.id')}`);
if (localStorage.getItem("projectData.id")) {
router.push(`/dashboard/${ localStorage.getItem("projectData.id")}`);
} else {
const userWorkspaces = await getWorkspaces();
userWorkspace = userWorkspaces[0]._id;
router.push(`/dashboard/${ userWorkspace}`);
}
} catch (error) {
console.log('Error - Not logged in yet');
console.log("Error - Not logged in yet");
}
})();
// eslint-disable-next-line react-hooks/exhaustive-deps