Fix multiples API calls and methods

This commit is contained in:
Tiago Kayaya
2020-11-25 11:25:08 +01:00
parent 029d1e3e28
commit d1214e0313
7 changed files with 41 additions and 19 deletions
+16 -2
View File
@@ -20,11 +20,11 @@ export class AttachmentsService {
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
getEventAttachments(eventid: string): Observable<Attachment[]>{
getAttachmentsBySerial(serialNumber: string): Observable<Attachment[]>{
let geturl = environment.apiURL + 'attachments/GetAttachments';
let params = new HttpParams();
params = params.set("ParentId", eventid);
params = params.set("SerialNumber", serialNumber);
let options = {
headers: this.headers,
@@ -45,6 +45,20 @@ export class AttachmentsService {
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
getAttachmentsById(eventId: string): Observable<Attachment[]>{
let geturl = environment.apiURL + 'attachments/GetAttachmentsByEventId';
let params = new HttpParams();
params = params.set("ParentId", eventId);
/* params = params.set("SourceId", sourceid); */
let options = {
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
}