Files
doneit-web/src/app/module/notification/data/datasource/remote-notification.service.ts
T

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-06-27 16:53:45 +01:00
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`);
}
2024-12-06 11:21:32 +01:00
async notificationDeleteAll(userId: any) {
return await this.httpService.delete<NotificationOutputDTO>(`${this.baseUrl}/Notifications/${userId}`);
}
2024-06-27 16:53:45 +01:00
}