84 lines
2.2 KiB
JavaScript
84 lines
2.2 KiB
JavaScript
import BaseApiService from './BaseApiService';
|
|
|
|
export default class ContentService extends BaseApiService {
|
|
constructor() {
|
|
super('/api/content');
|
|
}
|
|
|
|
// Photo Slider Management
|
|
async getPhotoSliders(params = {}) {
|
|
return this.get('/photo-sliders', params);
|
|
}
|
|
|
|
async createPhotoSlider(sliderData) {
|
|
return this.upload('/photo-sliders', sliderData);
|
|
}
|
|
|
|
async updatePhotoSlider(id, sliderData) {
|
|
return this.upload(`/photo-sliders/${id}`, sliderData);
|
|
}
|
|
|
|
async deletePhotoSlider(id) {
|
|
return this.delete(`/photo-sliders/${id}`);
|
|
}
|
|
|
|
// Promotions Management
|
|
async getPromotions(params = {}) {
|
|
return this.get('/promotions', params);
|
|
}
|
|
|
|
async createPromotion(promotionData) {
|
|
return this.upload('/promotions', promotionData);
|
|
}
|
|
|
|
async updatePromotion(id, promotionData) {
|
|
return this.upload(`/promotions/${id}`, promotionData);
|
|
}
|
|
|
|
async deletePromotion(id) {
|
|
return this.delete(`/promotions/${id}`);
|
|
}
|
|
|
|
// System Parameters
|
|
async getSystemParameters(params = {}) {
|
|
return this.get('/system-parameters', params);
|
|
}
|
|
|
|
async updateSystemParameter(id, paramData) {
|
|
return this.put(`/system-parameters/${id}`, paramData);
|
|
}
|
|
|
|
// Top-up Settings
|
|
async getTopUpSettings(params = {}) {
|
|
return this.get('/top-up-settings', params);
|
|
}
|
|
|
|
async updateTopUpSetting(id, settingData) {
|
|
return this.put(`/top-up-settings/${id}`, settingData);
|
|
}
|
|
|
|
// Notifications
|
|
async getNotifications(params = {}) {
|
|
return this.get('/notifications', params);
|
|
}
|
|
|
|
async createNotification(notificationData) {
|
|
return this.post('/notifications', notificationData);
|
|
}
|
|
|
|
async updateNotification(id, notificationData) {
|
|
return this.put(`/notifications/${id}`, notificationData);
|
|
}
|
|
|
|
async deleteNotification(id) {
|
|
return this.delete(`/notifications/${id}`);
|
|
}
|
|
|
|
async sendNotification(id) {
|
|
return this.post(`/notifications/${id}/send`);
|
|
}
|
|
|
|
async batchDelete(type, ids) {
|
|
return this.post(`/${type}/batch-delete`, { ids });
|
|
}
|
|
}
|