You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and when changes are made, either to the team or their assignments, the entire team object including their assignments is sent back to the API to be persisted.
There are 3 sortable areas.
Teams
Property Assignments
User Assignments
As you can see there is no id column for DnDkit to work (and even if there was id's they wouldn't be unique enough as they are normally sequential)
I can't work out which one would be the best and why, both have their pros and cons.
I like working with 'Record's when dragging and dropping but then saving it back to the API it a nightmare.
But just adding the id as a field makes things so much easier when updating the API, but working with an array of objects in onDragOver and onDragEnd frustrates the hell out of me.
How would you go about doing it?
There's only so much my rubber duck can do :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I pull data from an API.
The response looks like this
and when changes are made, either to the team or their assignments, the entire team object including their assignments is sent back to the API to be persisted.
There are 3 sortable areas.
As you can see there is no
id
column for DnDkit to work (and even if there was id's they wouldn't be unique enough as they are normally sequential)So, as it needs to follow this model
It's going to have to be either adding the
id
as another field to the array of objects...or converting them to a
Record
or maybe even aMap
...I can't work out which one would be the best and why, both have their pros and cons.
I like working with 'Record's when dragging and dropping but then saving it back to the API it a nightmare.
But just adding the
id
as a field makes things so much easier when updating the API, but working with an array of objects in onDragOver and onDragEnd frustrates the hell out of me.How would you go about doing it?
There's only so much my rubber duck can do :)
Beta Was this translation helpful? Give feedback.
All reactions