Hi,
I'm having trouble with adding a new event in Calendar. If I create a new event and remove the resource assignment (Calendar pulldown when creating the event) I get repeated sync (CRUD) calls. If I leave the assignment in there it works fine.
calendarConfig: Partial<CalendarConfig> = {
date: new Date(),
crudManager: new CrudManager({
autoLoad: true,
autoSync: true,
validateResponse: true,
transport: {
load: {
url: Endpoints.apiEndpoint() + "/api/v1/projectcalendar/" + this.projectIDService.getProjectId(),
// HTTP request parameter used to pass serialized "load"-requests
paramName: 'data',
// pass few Fetch API options
method: 'GET',
credentials: 'include',
cache: 'no-cache',
headers: { 'Authorization': this.appService.getAccessTokenType() + " " + this.appService.getAccessToken() }
},
sync: {
url: Endpoints.apiEndpoint() + "/api/v1/projectcalendar/" + this.projectIDService.getProjectId(),
// specify Content-Type for requests
headers: {
'Content-Type': 'application/json',
'Authorization': this.appService.getAccessTokenType() + " " + this.appService.getAccessToken()
},
credentials: 'include',
// pass few Fetch API options
method: 'POST',
cache: 'no-cache'
}
},
listeners: {
// listen to load request errors
loadFail : this.onError,
// listen to sync request errors
syncFail : this.onError
}
})
};
Incoming to backend
{
"type": "sync",
"requestId": 16631816993231,
"revision": 272,
"events": {
"added": [
{
"startDate": "2022-09-12T05:15:00-06:00",
"endDate": "2022-09-12T06:15:00-06:00",
"duration": 1,
"durationUnit": "hour",
"cls": "",
"name": "fghfgh",
"exceptionDates": [],
"allDay": false,
"$PhantomId": "_generatedc3"
}
]
}
}
Sync response
{
"success": true,
"requestId": 16631816993231,
"revision": 273,
"events": {
"rows": [
{
"$PhantomId": "_generatedc3",
"id": 247
}
]
}
}
I've been looking at this for a few days but I haven't been able to find the problem.
Thanks!