Add sending message of error to delete handler for entities proxy requests

This commit is contained in:
qowevisa 2024-11-16 20:28:53 +02:00
parent 5566d1f78f
commit b07a3f1a6e

View File

@ -173,7 +173,8 @@ export async function remove(groupName: string, id: number, session?: string): P
try { try {
const response = await fetch(url, config); const response = await fetch(url, config);
if (!response.ok) { if (!response.ok) {
throw new Error(`Failed to delete ${groupName}: ${response.statusText}`); const body = await response.json()
throw new Error(`Failed to delete ${groupName}: ${body.message}`);
} }
return await response.json() as Message; return await response.json() as Message;
} catch (err) { } catch (err) {