import apiClient from "@/api/client";

export interface Department {
	departmentId: string;
	name: string;
	para1: string;
	para2: string;
	para3: string;
	facilities: string;
	services: string;
}

export const getDepartmentsApi = async () => {
	const res = await apiClient.get("/departments/getAll");
	return res.data;
};

export const createDepartmentApi = async (data: {
	departmentId: string;
	name: string;
	para1?: string;
	para2?: string;
	para3?: string;
	facilities?: string;
	services?: string;
}) => {
	const res = await apiClient.post("/departments", data);
	return res.data;
};

export const updateDepartmentApi = async (
	departmentId: string,
	data: {
		name?: string;
		para1?: string;
		para2?: string;
		para3?: string;
		facilities?: string;
		services?: string;
	},
) => {
	const res = await apiClient.put(`/departments/${departmentId}`, data);
	return res.data;
};

export const deleteDepartmentApi = async (departmentId: string) => {
	const res = await apiClient.delete(`/departments/${departmentId}`);
	return res.data;
};
