Improve search

This commit is contained in:
Peter Maquiran
2021-04-19 15:21:35 +01:00
parent bd2a2fd3f4
commit 8b26ffd9a5
8 changed files with 116 additions and 36 deletions
+20 -4
View File
@@ -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);
}
}
+2 -2
View File
@@ -158,7 +158,7 @@ export class EventsService {
params: params
};
return this.http.post<Event>(`${puturl}`, event, options)
return this.http.post<string>(`${puturl}`, event, options)
}
postEventPr(event:Event, calendarName:string)
@@ -173,7 +173,7 @@ export class EventsService {
params: params
};
return this.http.post<Event>(`${puturl}`, event, options)
return this.http.post<string>(`${puturl}`, event, options)
}
deleteEvent(eventid:string, deletemode:number)