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 token = localStorage.getItem("accessToken") ?? "";
|
||||
const response = await api.checkIfProjectManager(projectName, token);
|
||||
console.log(response.data);
|
||||
if (response.success) {
|
||||
if (response.data) {
|
||||
if (
|
||||
(response.data as unknown as { isProjectManager: boolean })
|
||||
.isProjectManager
|
||||
) {
|
||||
navigate(`/PMProjectPage/${projectName}`);
|
||||
} else {
|
||||
navigate(`/project/${projectName}`);
|
||||
|
|
Loading…
Reference in a new issue