fix(tours): restrict permanent deletion to tours workspace

This commit is contained in:
elmocito
2026-10-06 12:52:25 +02:00
parent 04c7491e2a
commit 8739b4c74d
17 changed files with 456 additions and 39 deletions
+5
View File
@@ -54,6 +54,11 @@ export function useTourPlaceIds(tripId: number, enabled: boolean) {
|| !activeRequestRef.current.enabled) return
const added = change?.placeIds ?? []
const removed = change?.removedPlaceIds ?? []
if (removed.length) {
setTourData(current => current?.tripId === tripId
? { tripId, tours: current.tours.filter(tour => !removed.includes(tour.place_id)) }
: current)
}
if (added.length || removed.length) {
setPendingPlaceIds(current => {
const ids = new Set(current?.tripId === tripId ? current.ids : [])