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