synapse-admin/src/components/etke.cc/schedules/hooks/useRecurringCommands.tsx
Borislav Pantaleev 0832c43d76
(etke.cc-exclusive) Server Actions page (#457)
* WIP: add scheduler commands

* refactor scheduler commands page

* WIP on CRUD for ScheduledCommands

* more refactoring, finish CRUD On scheduled pages

* Add info text about Scheduler service

* Finish recurring commands add/edit

* add more texts

* fix server status behavior on not-loaded-yet state; adjust texts; lint fixes

* add link to the help pages in the commands palette

* Move Commands Panel to ServerSchedulesPage

* Rename Server Schedules to Server Actions

* more texts, a bit changed visual of the actions page, lint fix

* add docs

* fix tests

* Add UTC label to scheduled command create/edit
2025-04-11 12:41:47 +03:00

16 lines
480 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { useDataProvider } from "react-admin";
import { useAppContext } from "../../../../Context";
export const useRecurringCommands = () => {
const { etkeccAdmin } = useAppContext();
const dataProvider = useDataProvider();
const { data, isLoading, error } = useQuery({
queryKey: ["recurringCommands"],
queryFn: () => dataProvider.getRecurringCommands(etkeccAdmin),
});
return { data, isLoading, error };
};