refactor(web/api): errCode + errMessage helpers; 41 sites migrated (W1)

This commit is contained in:
2026-05-07 22:17:45 -04:00
parent 965df28127
commit 9c91a342e2
16 changed files with 138 additions and 70 deletions
+3 -5
View File
@@ -9,7 +9,7 @@
approveRequest,
rejectRequest
} from '$lib/api/admin';
import { copyForCode } from '$lib/api/error-copy';
import { errMessage } from '$lib/api/errors';
import StatusPill from '$lib/components/StatusPill.svelte';
import type { LidarrRequest, LidarrRequestKind, LidarrRequestStatus } from '$lib/api/types';
@@ -114,8 +114,7 @@
}
await invalidate();
} catch (e) {
const code = (e as { code?: string }).code ?? 'unknown';
showToast(copyForCode(code));
showToast(errMessage(e));
}
}
@@ -155,8 +154,7 @@
await rejectRequest(r.id, notes ? notes : undefined);
await invalidate();
} catch (e) {
const code = (e as { code?: string }).code ?? 'unknown';
showToast(copyForCode(code));
showToast(errMessage(e));
}
}