Files
Checkmate/client/src/pages/notification-channels/NotificationChannelsCreate.tsx
T

21 lines
733 B
TypeScript
Raw Normal View History

2025-11-13 13:47:26 -08:00
import { NotificationChannelsForm } from "./NotificationChannelsForm";
import { useNavigate } from "react-router";
import { usePost } from "@/hooks/UseApi";
import type { INotificationChannel } from "@/types/notification-channel";
2025-12-28 19:12:35 +00:00
import type { FormValues } from "./NotificationChannelsForm";
2025-11-13 13:47:26 -08:00
const NotificationsChannelCreatePage = () => {
const { post, loading } = usePost<FormValues, INotificationChannel>();
const navigate = useNavigate();
const onSubmit = async (data: FormValues) => {
const res = await post("/notification-channels", data);
if (res) {
navigate(-1);
}
};
return <NotificationChannelsForm onSubmit={onSubmit} loading={loading} />;
};
export default NotificationsChannelCreatePage;