mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-30 01:07:07 +03:00
encode notice ids in notice action urls
Notice ids went into the URL raw, so a detector on a repeated device like openvino:GPU#2 had everything after the # dropped as a fragment. The acknowledge, mute, and unhide requests 404'd and the buttons did nothing. The hooks now encode the id.
This commit is contained in:
@@ -58,7 +58,7 @@ export function useHealthProblems(
|
||||
|
||||
const muteCheck = useCallback(
|
||||
async (id: string) => {
|
||||
await axios.post(`notices/${id}/mute`);
|
||||
await axios.post(`notices/${encodeURIComponent(id)}/mute`);
|
||||
mutateMutedChecks();
|
||||
},
|
||||
[mutateMutedChecks],
|
||||
@@ -66,7 +66,7 @@ export function useHealthProblems(
|
||||
|
||||
const unmuteCheck = useCallback(
|
||||
async (id: string) => {
|
||||
await axios.delete(`notices/${id}/hidden`);
|
||||
await axios.delete(`notices/${encodeURIComponent(id)}/hidden`);
|
||||
mutateMutedChecks();
|
||||
},
|
||||
[mutateMutedChecks],
|
||||
|
||||
@@ -60,15 +60,17 @@ export function useNotices(showHidden: boolean) {
|
||||
);
|
||||
|
||||
const acknowledge = useCallback(
|
||||
(id: string) => act(axios.post(`notices/${id}/acknowledge`)),
|
||||
(id: string) =>
|
||||
act(axios.post(`notices/${encodeURIComponent(id)}/acknowledge`)),
|
||||
[act],
|
||||
);
|
||||
const mute = useCallback(
|
||||
(id: string) => act(axios.post(`notices/${id}/mute`)),
|
||||
(id: string) => act(axios.post(`notices/${encodeURIComponent(id)}/mute`)),
|
||||
[act],
|
||||
);
|
||||
const unhide = useCallback(
|
||||
(id: string) => act(axios.delete(`notices/${id}/hidden`)),
|
||||
(id: string) =>
|
||||
act(axios.delete(`notices/${encodeURIComponent(id)}/hidden`)),
|
||||
[act],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user