Change fingerprint of a function remove

This commit is contained in:
qowevisa 2024-11-10 11:21:23 +02:00
parent f8a80d7b71
commit 19424266ae

View File

@ -125,7 +125,7 @@ export async function update<T>(groupName: string, id: number, data: T, session?
} }
} }
export async function remove<T>(groupName: string, id: number, session?: string): Promise<T | ErrorMessage> { export async function remove(groupName: string, id: number, session?: string): Promise<Message | ErrorMessage> {
const url = `${BASE_API_URL}/${groupName}/delete/${id}` const url = `${BASE_API_URL}/${groupName}/delete/${id}`
const defaultHeaders = { const defaultHeaders = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -145,7 +145,7 @@ export async function remove<T>(groupName: string, id: number, session?: string)
if (!response.ok) { if (!response.ok) {
throw new Error(`Failed to delete ${groupName}: ${response.statusText}`); throw new Error(`Failed to delete ${groupName}: ${response.statusText}`);
} }
return await response.json() as T; return await response.json() as Message;
} catch (err) { } catch (err) {
const error = err as Error const error = err as Error
return { message: error.message }; return { message: error.message };