mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
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`);
|
|
}
|
|
|
|
|
|
async notificationDeleteAll(userId: any) {
|
|
return await this.httpService.delete<NotificationOutputDTO>(`${this.baseUrl}/Notifications/${userId}`);
|
|
}
|
|
|
|
}
|