mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
New changes added + AddEvent method partially done
This commit is contained in:
@@ -6,6 +6,7 @@ import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -69,6 +70,49 @@ export class EventsService {
|
||||
return this.http.get<Event>(`${url + ev}`, this.options)
|
||||
}
|
||||
|
||||
AddEvent(postEvent: any){
|
||||
const url = 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/api/calendar/PostEvent';
|
||||
const mydata = JSON.stringify({
|
||||
"AppointmentState":1,
|
||||
"Body":{"BodyType":1,"Text":"Noooooo"},
|
||||
"CalendarId":"AAMkAGMwNTJiZDY2LTZjN2MtNDgzYS1hNzAzLTZhZWRhNTk3ZWNiMAAuAAAAAABgX8u97PeNQrYTHXctnZkcAQB4Hy3hTowgSI7Yp8YAVgKKAAACCd9zAAA=",
|
||||
"EndDate":"8/16/2020 6:00:00 PM",
|
||||
"EventType":"Single","HasAttachments":false,
|
||||
"IsMeeting":true,"IsRecurring":false,
|
||||
"Location":postEvent.Location,
|
||||
"OptionalAttendees":null,
|
||||
"Organizer":{"EmailAddress":"paulo.pinto@gabinetedigital.local","Name":"Paulo Pinto"},
|
||||
"RequiredAttendees":[{"EmailAddress":"Administrator@gabinetedigital.local","Name":"Administrator"},{"EmailAddress":"tiago.kayaya@gabinetedigital.local","Name":"Tiago Kayaya"}],
|
||||
"StartDate":"8/14/2020 5:30:00 PM",
|
||||
"Subject":postEvent.Subject,
|
||||
"TimeZone":"(UTC+01:00) Centro-Oeste da África"});
|
||||
/* const options = {
|
||||
method: 'post',
|
||||
url: 'url',
|
||||
headears: {
|
||||
'Authorization': 'Basic Z2FiaW5ldGVkaWdpdGFsLmxvY2FsXHBhdWxvLnBpbnRvOnRhYnRlc3RlQDAwNg==',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: data
|
||||
} */
|
||||
console.log(postEvent.Subject);
|
||||
axios({
|
||||
method: 'post',
|
||||
url: url,
|
||||
data: mydata,
|
||||
headers: {'Authorization': 'Basic Z2FiaW5ldGVkaWdpdGFsLmxvY2FsXHBhdWxvLnBpbnRvOnRhYnRlc3RlQDAwNg==',
|
||||
'Content-Type': 'application/json' }
|
||||
})
|
||||
.then(function (response) {
|
||||
//handle success
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function (response) {
|
||||
//handle error
|
||||
console.log(response);
|
||||
});
|
||||
}
|
||||
|
||||
getStaticEvent(eventId: string){
|
||||
return {
|
||||
// The find() function looks for an event in a array and return true if found
|
||||
@@ -78,4 +122,5 @@ export class EventsService {
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user