Our pure JavaScript Scheduler component


Post by Gopika »

Okay, but what I wanted to show you was in that request you can see exceptionDates for a events in added? And because of this it fails in adding event. Invalid Json is what I get in response. I will try to send you the request and response of adding an event first and then editing the evetnt.


Post by Gopika »

Attaching the request and responses I get when I add a recurring event and edit it

Step 1. Going to create a recurring event
Request

 {
   "type":"sync",
   "requestId":15974257052394,
   "revision":1,
   "events":{
      "added":[
         {
            "resourceId":16,
            "recurrenceRule":"FREQ=WEEKLY;BYDAY=MO,TU,TH",
            "startDate":"2020-08-09T23:30:00.000Z",
            "endDate":"2020-08-10T07:30:00.000Z",
            "duration":0.3333333333333333,
            "durationUnit":"d",
            "cls":"",
            "name":"Recurr event",
            "$PhantomId":"_generated_0x5c177b14"
         }
      ]
   }
}

The response I get

{
   "resources":null,
   "events":{
      "rows":[
         {
            "$PhantomId":"_generated_0x5c177b14",
            "id":307
         }
      ],
      "removed":null
   },
   "assignments":null,
   "revision":1,
   "success":true,
   "requestId":15974257052394
}

Step 2: Going to edit one of the event of the recurring event

{
   "type":"sync",
   "requestId":15974259443391,
   "revision":1,
   "events":{
      "added":[
         {
            "resourceId":"16",
            "recurringTimeSpanId":null,
            "recurrenceRule":null,
            "exceptionDates":null,
            "startDate":"2020-08-12T23:30:00.000Z",
            "endDate":"2020-08-13T10:30:00.000Z",
            "duration":0.4583333333333333,
            "durationUnit":"d",
            "cls":"",
            "name":"Recurr event",
            "$PhantomId":"_generated_0x5c177b13"
         }
      ],
      "updated":[
         {
            "exceptionDates":[
               "2020-08-12T23:30:00.000Z"
            ],
            "id":307
         }
      ]
   }
}

Response

{
   "resources":null,
   "events":{
      "rows":[
         {
            "$PhantomId":"_generated_0x5c177b13",
            "id":309
         },
         {
            "id":307
         }
      ],
      "removed":null
   },
   "assignments":null,
   "revision":1,
   "success":true,
   "requestId":15974259443391
}

Step 3:Again going to edit another event in the recurring event

{
   "type":"sync",
   "requestId":15974261244031,
   "revision":1,
   "events":{
      "added":[
         {
            "resourceId":"16",
            "recurringTimeSpanId":null,
            "recurrenceRule":null,
            "exceptionDates":[
               "2020-08-12T23:30:00.000Z"
            ],
            "startDate":"2020-08-16T23:30:00.000Z",
            "endDate":"2020-08-17T06:30:00.000Z",
            "duration":0.2916666666666667,
            "durationUnit":"d",
            "cls":"",
            "name":"Recurr event",
            "$PhantomId":"_generated_0x5c177b37"
         }
      ],
      "updated":[
         {
            "exceptionDates":[
               "2020-08-12T23:30:00.000Z",
               "2020-08-16T23:30:00.000Z"
            ],
            "id":307
         }
      ]
   }
}

Response I get is - Error, Invalid sync JSONUnexpected character encountered while parsing value: [. Path 'events.added[0].exceptionDates', line 1, position 264.


Post by Maxim Gorkovsky »

Gopika wrote: Fri Aug 14, 2020 6:40 pm

Okay, but what I wanted to show you was in that request you can see exceptionDates for a events in added? And because of this it fails in adding event. Invalid Json is what I get in response. I will try to send you the request and response of adding an event first and then editing the evetnt.

I explained this problem before:

Model is used in deserializing JSON into class instances. If you want to change field type on the backend you'll have to use two fields: one to serialize/deserialize JSON and other to store data to DB. Please refer to the net core json library documentation. This question is really out of the scope of this forum as it is related to .NET Core.


Post Reply