Question about hooks.

`
const Home: NextPage = () => {
  const { data } = api.companyemployees.getCriticalContracts.useQuery(7);
  
  const handleSnooze =  (contractId: number) => {
    try {
      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
      const response =  api.contracts.snoozeContract.useMutation({ contractId });
      // Handle success response
      console.log("Snooze successful:", response);
    } catch (error) {
      // Handle error
      console.error("Failed to snooze:", error);
    }
  };
`
Is it impossible to run handleSnooze like this on the frontend?

If so, can somebody give me some pointers, please?
Was this page helpful?