Merge branch 'frontend' into gruppPP

This commit is contained in:
Peter KW 2024-04-02 13:18:25 +02:00
commit ea5bbf5f0a

View file

@ -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}`);