mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
New Attachmentes Page with Skeleton. EventAttachments Model revised. Compatibility with v2. Get Attachments revised.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AttachmentsService } from './attachments.service';
|
||||
|
||||
describe('AttachmentsService', () => {
|
||||
let service: AttachmentsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(AttachmentsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Event } from '../models/event.model';
|
||||
import axios from 'axios'
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { User } from '../models/user.model';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -55,7 +54,7 @@ export class EventsService {
|
||||
}
|
||||
|
||||
getEvent(eventid: string): Observable<Event>{
|
||||
const geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
@@ -65,7 +64,7 @@ export class EventsService {
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Event>(`${geturl}`, options)
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
putEvent(event: Event, conflictResolutionMode:number, sendInvitationsOrCancellationsMode:number): Observable<Event>
|
||||
|
||||
Reference in New Issue
Block a user