Trip 페이지에서 하는 것

TripsClient 컴포넌트에서 하는것

const onCancel = useCallback(
    (id: string) => {
      setDeletingId(id);

      axios
        .delete(`/api/reservations/${id}`)
        .then(() => {
          toast.success('Reservations canceled');
          router.refresh();
        })
        .catch((error) => {
          toast.error(error?.response?.data.error);
        })
        .finally(() => {
          setDeletingId('');
        });
    },
    [router]
  );