ITOTEAM-523 notification status

This commit is contained in:
Peter Maquiran
2024-06-27 16:53:45 +01:00
parent 78c13d1bfb
commit 11587cc944
23 changed files with 686 additions and 111 deletions
@@ -0,0 +1,29 @@
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<NotificationOutputDTO>(`${this.baseUrl}/Notifications`, queryParameter);
}
async notificationStatus(id: string) {
return await this.httpService.patch<NotificationOutputDTO>(`${this.baseUrl}/Notifications/${id}/status`);
}
}