import { useMutation } from "@tanstack/react-query"
import axios from "axios";

const createNotification = async (data: {
    title: string;
    message: string;
    type?: string;
    target_type_id: number;
    user_ids?: number[];
}) => {
    const response = await axios.post("/notification/send", data);
    return response.data;
}

export const UseCreateNotification = () => useMutation({
    mutationFn: (data: {
        title: string;
        message: string;
        type?: string;
        target_type_id: number;
        user_ids?: number[];
    }) => createNotification(data)
})