From d1be752ac3a58325e582ca56aa18f4fa3809feba Mon Sep 17 00:00:00 2001 From: Peter KW Date: Wed, 20 Mar 2024 18:35:02 +0100 Subject: [PATCH] getAllUsersProject uses new type --- frontend/src/API/API.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index f05d698..69a46af 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -4,7 +4,7 @@ import { User, Project, NewProject, - PublicUser, + UserProjectMember, } from "../Types/goTypes"; // This type of pattern should be hard to misuse @@ -52,7 +52,7 @@ interface API { getAllUsersProject( projectName: string, token: string, - ): Promise>; + ): Promise>; } // Export an instance of the API @@ -318,7 +318,7 @@ export const api: API = { async getAllUsersProject( projectName: string, token: string, - ): Promise> { + ): Promise> { try { const response = await fetch(`/api/getUsersProject/${projectName}`, { method: "GET", @@ -334,7 +334,7 @@ export const api: API = { message: "Failed to get users", }); } else { - const data = (await response.json()) as User[]; + const data = (await response.json()) as UserProjectMember[]; return Promise.resolve({ success: true, data }); } } catch (e) {