mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve search
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Attachment } from '../models/attachment.model';
|
||||
import { Attachment, EventAttachment } from '../models/attachment.model';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@@ -33,7 +33,7 @@ export class AttachmentsService {
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAttachments(source: number, sourceid: string): Observable<Attachment[]>{
|
||||
getAttachments(source: number, sourceid: string): Observable<Attachment[]> {
|
||||
let geturl = environment.apiURL + 'attachments/GetSourceName';
|
||||
let params = new HttpParams();
|
||||
|
||||
@@ -47,18 +47,34 @@ export class AttachmentsService {
|
||||
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
}
|
||||
getAttachmentsById(eventId: string): Observable<Attachment[]>{
|
||||
|
||||
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 = {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Attachment[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
setEventAttachmentById(body: EventAttachment) {
|
||||
|
||||
let geturl = environment.apiURL + 'Attachments/Create';
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
}
|
||||
|
||||
alert('send');
|
||||
|
||||
console.log('send', body);
|
||||
return this.http.post(`${geturl}`, body, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user