mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
updated api to fetch specific map items from backend
This commit is contained in:
parent
075576b5d0
commit
d1bd58cfa8
@ -9,11 +9,12 @@ export class itemsApi<T> implements ItemsApi<T>{
|
||||
collectionName: string;
|
||||
filter: any;
|
||||
|
||||
constructor(collectionName: string, layerId?: string | undefined, filter?: any, ) {
|
||||
constructor(collectionName: string, layerId?: string | undefined, mapId?: string | undefined, filter?: any, ) {
|
||||
this.collectionName = collectionName;
|
||||
if(filter) this.filter = filter;
|
||||
else this.filter = {};
|
||||
if(layerId) this.filter = {... filter, ... { "layer" : { "id": { "_eq": layerId }}}}
|
||||
if(mapId) this.filter = {... filter, ... { "map" : { "id": { "_eq": mapId }}}}
|
||||
console.log(this.filter);
|
||||
|
||||
}
|
||||
|
||||
@ -23,8 +23,8 @@ function MapContainer() {
|
||||
|
||||
setPlacesApi(new itemsApi<Place>('places',"e31de961-6709-4413-a27d-00e59ccfe472"));
|
||||
setEventsApi(new itemsApi<Event>('events', "1837e83e-07f1-44c0-88c0-8e9ea8e597db"));
|
||||
setUpdatesApiInstance(new itemsApi('updates',"b4dd8b6b-80e8-4173-9682-4a5755e7b9cb",{"latest":{"_eq": true}}));
|
||||
setTagsApi(new itemsApi<Tag>('tags'));
|
||||
setUpdatesApiInstance(new itemsApi('updates',"b4dd8b6b-80e8-4173-9682-4a5755e7b9cb", undefined, {"latest":{"_eq": true}}));
|
||||
setTagsApi(new itemsApi<Tag>('tags', undefined, "8bf681a4-1b8d-44ba-afba-c6dbf79a769f"));
|
||||
// setRefiApi(new refiBcnApi('refi'));
|
||||
setPermissionsApiInstance(new permissionsApi());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user