Merge branch 'frontend' into gruppPP
This commit is contained in:
commit
ea5bbf5f0a
1 changed files with 5 additions and 1 deletions
|
@ -20,8 +20,12 @@ function DisplayUserProject(): JSX.Element {
|
||||||
const handleProjectClick = async (projectName: string): Promise<void> => {
|
const handleProjectClick = async (projectName: string): Promise<void> => {
|
||||||
const token = localStorage.getItem("accessToken") ?? "";
|
const token = localStorage.getItem("accessToken") ?? "";
|
||||||
const response = await api.checkIfProjectManager(projectName, token);
|
const response = await api.checkIfProjectManager(projectName, token);
|
||||||
|
console.log(response.data);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
if (response.data) {
|
if (
|
||||||
|
(response.data as unknown as { isProjectManager: boolean })
|
||||||
|
.isProjectManager
|
||||||
|
) {
|
||||||
navigate(`/PMProjectPage/${projectName}`);
|
navigate(`/PMProjectPage/${projectName}`);
|
||||||
} else {
|
} else {
|
||||||
navigate(`/project/${projectName}`);
|
navigate(`/project/${projectName}`);
|
||||||
|
|
Loading…
Reference in a new issue