mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
place-contrib: community hours in the details' own shape, and no origin rows for collection copies
Community opening hours laid over OSM details now go through the same parser as OSM's own, so they arrive as one line per day with open-now and the periods, and a community description lands in the details' summary. A place copied from a collection no longer records its values as an import: without an origin row a value is never sent anyway, and a later edit marks only the fields it changes.
This commit is contained in:
@@ -7,7 +7,6 @@ import { PermissionsService } from '../permissions/permissions.service';
|
||||
import { RealtimeService } from '../realtime/realtime.service';
|
||||
import { isUploadedPlaceImage } from '../places/place-image';
|
||||
import { PlacesService } from '../places/places.service';
|
||||
import { PlaceOriginsService } from '../places/place-origins.service';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
import { Collections } from '../../db/entities/Collections.entity';
|
||||
import { CollectionsRepository, type CollectionPlaceRow } from '../../db/repositories/Collections.repository';
|
||||
@@ -131,7 +130,6 @@ export class CollectionsService {
|
||||
@InjectRepository(Users) private readonly users: UsersRepository,
|
||||
private readonly placeImport: PlaceImportService,
|
||||
private readonly places: PlacesService, // the journey hook of every place copyToTrip adds
|
||||
private readonly origins: PlaceOriginsService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -1188,8 +1186,6 @@ export class CollectionsService {
|
||||
created.push({ id: newPlaceId, source_id: s.id });
|
||||
}
|
||||
});
|
||||
// A copied value is the collection's, not typed in this write: recorded as an import, never shared.
|
||||
if (created.length > 0) await this.origins.recordImported(created.map(({ id }) => id));
|
||||
const rows = await Promise.all(created.map(({ id }) => this.tripPlaces.findWithTagsAndRatings(id))); // reads only
|
||||
for (const [i, place] of rows.entries()) {
|
||||
if (place) events.emit('place:created', { place }); // as the place routes send it
|
||||
|
||||
Reference in New Issue
Block a user