mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
30 lines
970 B
TypeScript
30 lines
970 B
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`);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|