mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 00:43:15 +00:00
fix(ci): one save-to-list mapping for both All places views
lint:dup found the trip place to save dialog mapping copied in the desktop and phone views of All places; it is now saveDraftOf in libraryPairs, with a test.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import CollectionMap from '../../../components/Collections/CollectionMap';
|
||||
import { saveDraftOf } from '../../../components/Collections/libraryPairs';
|
||||
import { originName } from '../../../components/Collections/originName';
|
||||
import { usePlaceDuplicates } from '../../../components/Collections/usePlaceDuplicates';
|
||||
import { usePlacesLibrary, type LibraryKindFilter } from '../../../components/Collections/usePlacesLibrary';
|
||||
@@ -429,21 +430,7 @@ export default function MPlacesLibrary({ categories, language, dark, view, onVie
|
||||
onClose={lib.close}
|
||||
onOpenList={(collectionId, placeId) => navigate(`${placesPath(collectionId)}?place=${placeId}`)}
|
||||
onOpenTrip={(tripId, placeId) => navigate(`/trips/${tripId}?place=${placeId}`)}
|
||||
onSaveToList={(origin, d) =>
|
||||
openSave({
|
||||
name: d.info.name,
|
||||
source_trip_id: origin.trip_id,
|
||||
source_place_id: origin.place_id,
|
||||
description: d.info.description,
|
||||
lat: d.info.lat,
|
||||
lng: d.info.lng,
|
||||
address: d.info.address,
|
||||
category_id: lib.detail?.entry.category?.id ?? null,
|
||||
image_url: d.info.image_url,
|
||||
website: d.info.website,
|
||||
phone: d.info.phone,
|
||||
})
|
||||
}
|
||||
onSaveToList={(origin, d) => openSave(saveDraftOf(origin, d, lib.detail?.entry.category?.id))}
|
||||
onCopyToTrip={(id) => {
|
||||
lib.close();
|
||||
setCopyId(id);
|
||||
|
||||
Reference in New Issue
Block a user