New Attachmentes Page with Skeleton. EventAttachments Model revised. Compatibility with v2. Get Attachments revised.

This commit is contained in:
Paulo Pinto
2020-08-24 23:41:15 +01:00
parent 91147ef6b9
commit 751b8dd7c5
23 changed files with 494 additions and 74 deletions
+36
View File
@@ -0,0 +1,36 @@
import { Injectable } from '@angular/core';
import { Attachment } from '../models/attachment.model';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
@Injectable({
providedIn: 'root'
})
export class AttachmentsService {
loggeduser: User;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
getEventAttachments(eventid: string): Observable<Attachment[]>{
let geturl = environment.apiURL + 'attachments/GetAttachments';
let params = new HttpParams();
params = params.set("ParentId", eventid);
let options = {
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
}