refactor(web/api): errCode + errMessage helpers; 41 sites migrated (W1)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user