mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-11 09:37:37 +03:00
Cleanup typing
This commit is contained in:
parent
c8aae7745f
commit
d72f89492d
@ -497,17 +497,12 @@ function CaseAssignmentDialog({
|
|||||||
mutate();
|
mutate();
|
||||||
onClose();
|
onClose();
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
const apiError = error as {
|
||||||
|
response?: { data?: { message?: string; detail?: string } };
|
||||||
|
};
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
(
|
apiError.response?.data?.message ||
|
||||||
error as {
|
apiError.response?.data?.detail ||
|
||||||
response?: { data?: { message?: string; detail?: string } };
|
|
||||||
}
|
|
||||||
).response?.data?.message ||
|
|
||||||
(
|
|
||||||
error as {
|
|
||||||
response?: { data?: { message?: string; detail?: string } };
|
|
||||||
}
|
|
||||||
).response?.data?.detail ||
|
|
||||||
"Unknown error";
|
"Unknown error";
|
||||||
toast.error(t("toast.error.assignCaseFailed", { errorMessage }), {
|
toast.error(t("toast.error.assignCaseFailed", { errorMessage }), {
|
||||||
position: "top-center",
|
position: "top-center",
|
||||||
@ -538,17 +533,12 @@ function CaseAssignmentDialog({
|
|||||||
mutate();
|
mutate();
|
||||||
onClose();
|
onClose();
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
const apiError = error as {
|
||||||
|
response?: { data?: { message?: string; detail?: string } };
|
||||||
|
};
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
(
|
apiError.response?.data?.message ||
|
||||||
error as {
|
apiError.response?.data?.detail ||
|
||||||
response?: { data?: { message?: string; detail?: string } };
|
|
||||||
}
|
|
||||||
).response?.data?.message ||
|
|
||||||
(
|
|
||||||
error as {
|
|
||||||
response?: { data?: { message?: string; detail?: string } };
|
|
||||||
}
|
|
||||||
).response?.data?.detail ||
|
|
||||||
"Unknown error";
|
"Unknown error";
|
||||||
toast.error(t("toast.error.assignCaseFailed", { errorMessage }), {
|
toast.error(t("toast.error.assignCaseFailed", { errorMessage }), {
|
||||||
position: "top-center",
|
position: "top-center",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user