Add vercel.json

This commit is contained in:
Hazem Krimi
2023-05-06 18:49:24 +01:00
parent eee11259db
commit 6a50a707d9
2 changed files with 16 additions and 16 deletions
+13 -16
View File
@@ -2,13 +2,7 @@ import jwtDecode from 'jwt-decode';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Routes, Route, Navigate } from 'react-router-dom'; import { Routes, Route, Navigate } from 'react-router-dom';
import { useLazyQuery, useReactiveVar } from '@apollo/client'; import { useLazyQuery, useReactiveVar } from '@apollo/client';
import { import { Protected, Public, Navbar, Sidebar, Spinner } from './components';
Protected,
Public,
Navbar,
Sidebar,
Spinner,
} from './components';
import { roleVar, tokenVar, userVar } from './graphql/state'; import { roleVar, tokenVar, userVar } from './graphql/state';
import { import {
AdditionalInfo, AdditionalInfo,
@@ -89,15 +83,18 @@ const App = () => {
</> </>
)} )}
<Routes> <Routes>
<Route path='/' element={ <Route
<Protected> path='/'
{role !== 'admin' ? ( element={
<Navigate to='/project' /> <Protected>
) : ( {role !== 'admin' ? (
<Navigate to='/clients' /> <Navigate to='/project' />
)} ) : (
</Protected> <Navigate to='/clients' />
} /> )}
</Protected>
}
/>
<Route <Route
path='/project' path='/project'
element={ element={
+3
View File
@@ -0,0 +1,3 @@
{
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
}