mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-29 17:32:20 +00:00
Merge pull request #126 from stephb9959/main
[WIFI-11545] Fixed event queue API
This commit is contained in:
@@ -31,12 +31,15 @@ export type EventQueueModalProps = {
|
||||
export const EventQueueModal = ({ serialNumber, modalProps }: EventQueueModalProps) => {
|
||||
const { t } = useTranslation();
|
||||
const eventQueue = useGetEventQueue();
|
||||
const { hasCopied, onCopy } = useClipboard(JSON.stringify(eventQueue.data ?? {}, null, 2));
|
||||
const { hasCopied, onCopy, setValue } = useClipboard(JSON.stringify(eventQueue.data ?? {}, null, 2));
|
||||
|
||||
const fetch = () => {
|
||||
eventQueue.mutate(serialNumber);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
setValue(JSON.stringify(eventQueue.data ?? {}, null, 2));
|
||||
}, [eventQueue.data]);
|
||||
React.useEffect(() => {
|
||||
if (modalProps.isOpen) fetch();
|
||||
}, [modalProps.isOpen]);
|
||||
|
||||
@@ -51,7 +51,7 @@ export const useDeleteCommand = () => {
|
||||
|
||||
return useMutation(deleteCommandHistory, {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries('commands');
|
||||
queryClient.invalidateQueries(['commands']);
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -93,7 +93,7 @@ export type EventQueueResponse = {
|
||||
const getEventQueue = async (serialNumber: string) =>
|
||||
axiosGw
|
||||
.post(`device/${serialNumber}/eventqueue`, {
|
||||
types: ['dhcp', 'wifi'],
|
||||
types: ['dhcp-snooping', 'wifi-frames'],
|
||||
serialNumber,
|
||||
})
|
||||
.then((response) => response.data as EventQueueResponse);
|
||||
|
||||
Reference in New Issue
Block a user