Hi,
I have asp.net core API with odata running on it and on the client-side I have react web app.
Now I have accomplished to get the data and show on the scheduler with the ODataV4Adaptor, but the rest of the crud actions doesn't work.
Can you provide a sample project with the correct odata approach?
The code that I now have on the clientside.
<ScheduleComponent
height='900px'
local='nl'
currentView='WorkWeek'
timezone='Europe/Amsterdam'
eventSettings={ {
fields: {
id: 'Oid',
subject: { name: 'Subject' },
isAllDay: { name: 'IsAllDay' },
startTime: { name: 'StartTime' },
endTime: { name: 'EndTime' }
},
dataSource: new DataManager({
url: '/odata/order',
crossDomain: true,
adaptor: new ODataV4Adaptor,
headers: [{
'AUTHORIZATION': `Bearer ${localStorage.getItem('token')}`
}],
})} }>
<ViewsDirective>
<ViewDirective option='WorkWeek' interval={1} timeScale={{ enable: true, slotCount: 4 }} startHour='07:00' endHour='18:00'/>
<ViewDirective option='Week' startHour='07:00' endHour='22:00'/>
<ViewDirective option='Month' showWeekNumber={true} showWeekend={true}/>
</ViewsDirective>
<Inject services={[Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop]}/>
</ScheduleComponent>
When I look in the console the POST URL is : https://localhost:5001/odata/$batch
But the GET URL is: https://localhost:5001/odata/order
I expect it to be :POST https://localhost:5001/odata/order/$batch or POST https://localhost:5001/odata/order
The exeption that i get on server side is : System.ArgumentException: An item with the same key has already been added. Key: Cookie