Files
gg-backend/frontend/src/api/newsMedia.ts
T

22 lines
642 B
TypeScript
Raw Normal View History

2026-05-26 15:48:01 +05:30
import apiClient from '@/api/client';
2026-03-26 11:20:03 +05:30
2026-05-26 15:48:01 +05:30
export const getNewsApi = async (page = 1, limit = 10, search = '') => {
const res = await apiClient.get(`/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) => {
2026-05-26 15:48:01 +05:30
const res = await apiClient.post('/newsMedia', data);
2026-03-26 11:20:03 +05:30
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;
};