You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
import {Injectable} from '@angular/core';
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
|
|
import { Observable } from 'rxjs';
|
|
import {AbsenceTransaction} from '../models/absence.transaction'
|
|
import {AbsenceAttahcmentResponse} from '../models/abs.attach.response'
|
|
|
|
@Injectable()
|
|
export class AbsenceListService {
|
|
public static getAbsenceTransaction='Services/ERP.svc/REST/GET_ABSENCE_TRANSACTIONS';
|
|
public static getAbsenceAttachment='Services/ERP.svc/REST/GET_ABSENCE_ATTACHMENTS';
|
|
constructor(
|
|
public api: ConnectorService,
|
|
public authService: AuthenticationService,
|
|
|
|
) { }
|
|
|
|
public getAbsenceList(absence: any, onError?: any, errorLabel?: string): Observable<AbsenceTransaction> {
|
|
const request = absence;
|
|
this.authService.authenticateRequest(request);
|
|
return this.api.post(AbsenceListService.getAbsenceTransaction, request, onError, errorLabel);
|
|
}
|
|
public getAbsenceAttachment(absence: any, onError?: any, errorLabel?: string): Observable<AbsenceAttahcmentResponse> {
|
|
const request = absence;
|
|
this.authService.authenticateRequest(request);
|
|
return this.api.post(AbsenceListService.getAbsenceAttachment, request, onError, errorLabel);
|
|
}
|
|
|
|
} |