feat: новая функция
This commit is contained in:
55
frontend/src/services/systemMessagesService.js
Normal file
55
frontend/src/services/systemMessagesService.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Сервис для работы с системными сообщениями
|
||||
*/
|
||||
|
||||
import api from '../api/axios';
|
||||
|
||||
const BASE_URL = '/system-messages';
|
||||
|
||||
export default {
|
||||
async getSystemMessages(params = {}) {
|
||||
const response = await api.get(BASE_URL, { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getPublishedSystemMessages(params = {}) {
|
||||
const response = await api.get(`${BASE_URL}/published`, { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getSystemMessage(id) {
|
||||
const response = await api.get(`${BASE_URL}/${id}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async createSystemMessage(payload) {
|
||||
const response = await api.post(BASE_URL, payload);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async updateSystemMessage(id, payload) {
|
||||
const response = await api.patch(`${BASE_URL}/${id}`, payload);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async deleteSystemMessage(id) {
|
||||
const response = await api.delete(`${BASE_URL}/${id}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async bulkPublish(ids) {
|
||||
const response = await api.post(`${BASE_URL}/bulk/publish`, { ids });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async bulkUnpublish(ids) {
|
||||
const response = await api.post(`${BASE_URL}/bulk/unpublish`, { ids });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async bulkDelete(ids) {
|
||||
const response = await api.post(`${BASE_URL}/bulk/delete`, { ids });
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user