2026-03-26 11:20:03 +05:30
|
|
|
import apiClient from "@/api/client";
|
|
|
|
|
|
2026-04-24 17:27:15 +05:30
|
|
|
export const getNewsApi = async (page = 1, limit = 10, search = "") => {
|
2026-03-26 11:20:03 +05:30
|
|
|
const res = await apiClient.get(
|
2026-04-24 17:27:15 +05:30
|
|
|
`/newsMedia/getAll?page=${page}&limit=${limit}&search=${search}`,
|
2026-03-26 11:20:03 +05:30
|
|
|
);
|
|
|
|
|
return res.data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const createNewsApi = async (data: any) => {
|
|
|
|
|
const res = await apiClient.post("/newsMedia", data);
|
|
|
|
|
return res.data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const updateNewsApi = async (id: number, data: any) => {
|
|
|
|
|
const res = await apiClient.patch(`/newsMedia/${id}`, data);
|
|
|
|
|
return res.data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteNewsApi = async (id: number) => {
|
|
|
|
|
const res = await apiClient.delete(`/newsMedia/${id}`);
|
|
|
|
|
return res.data;
|
|
|
|
|
};
|