import { Injectable } from '@angular/core'; import { HttpService } from 'src/app/services/http.service'; import { NotificationInputDTO } from '../dto/NotificationInputDTO'; import { NotificationOutputDTO, NotificationOutputDTOSchema } from '../dto/NotificationOutputDTO'; import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator'; @Injectable({ providedIn: 'root' }) export class RemoteNotificationService { private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; constructor( private httpService: HttpService ) { } @APIReturn(NotificationOutputDTOSchema, 'Get/Notifications') async getNotification(queryParameter: NotificationInputDTO) { return await this.httpService.get(`${this.baseUrl}/Notifications`, queryParameter); } async notificationStatus(id: string) { return await this.httpService.patch(`${this.baseUrl}/Notifications/${id}/status`); } async notificationDeleteAll(userId: any) { return await this.httpService.delete(`${this.baseUrl}/Notifications/${userId}`); } }