Crud waypoints - #23
Open
Michael-R-Dickinson wants to merge 19 commits into
Open
Conversation
…o crud-waypoints
Michael-R-Dickinson
marked this pull request as ready for review
January 17, 2025 03:58
jimgeng
reviewed
Jan 25, 2025
Contributor
There was a problem hiding this comment.
Just needs a small addition for now. Though we might need to write some new logic to handle adding to certain routes as well since that's breaking the whole route CRUD system right now. Can also consider removing the rest of the references to the params and commands.
Contributor
There was a problem hiding this comment.
The delete all waypoints logic should be updated as well in this file. (The one in the modal)
jimgeng
reviewed
Mar 1, 2025
Comment on lines
+41
to
+52
| const editWaypoint = async (waypoint: Waypoint) => { | ||
| // Update needs to be instant so that changes update on the map when we drag | ||
| // Before the server responds | ||
| // So if stuff goes wrong, we roll the changes back | ||
| const waypointSnapshot = [...waypoints]; | ||
| try { | ||
| setWaypoints(waypoints?.map((w) => (w.id === waypoint.id ? waypoint : w)) || []); | ||
| await updateWaypointQuery(waypoint); | ||
| } catch { | ||
| setWaypoints(waypointSnapshot); | ||
| } | ||
| }; |
Contributor
There was a problem hiding this comment.
In the future can consider updating this behaviour to show a error popup if it fails instead of silently failing (with the only way to tell being that the changes are reverted).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Resolves # (issue)
Type of change
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyHow Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. This is simply a reminder of what we are going to look for before merging your code.