import { Injectable } from '@angular/core'; import { CommonEnum } from "../../../../models/common-enum"; import { CoredataService } from '../../../../core/coredata.service'; @Injectable({ providedIn: 'root' }) export class SystemNotificationService { constructor(private coreData: CoredataService) { } getList(success, error) { this.coreData.Get(CommonEnum.SystemAPP, CommonEnum.NotificationAPI, null, (result) => { if (result != null) { return success(result); } return null; }, (error) => { return error(error); } ); } deleteById(id: number, success, error) { this.coreData.Delete(CommonEnum.SystemAPP, CommonEnum.NotificationAPI + '/' + id, null, (result) => { if (result != null) { return success(result); } return null; }, (error) => { return error(error); } ); } getById(id: number, success, error) { this.coreData.Get(CommonEnum.SystemAPP, CommonEnum.NotificationAPI + '/' + id, null, (result) => { if (result != null) { return success(result); } return null; }, (error) => { return error(error); }); } saveSystemNotification(formData, success, error) { this.coreData.PostUpload(CommonEnum.SystemAPP, CommonEnum.NotificationAPI, formData, (result) => { if (result != null) { return success(result); } return null; }, (error) => { return error(error); }); } }