feat(#17): Add an appraisal compare-by-location page
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import {universeApi} from '@/mammon/mammonService';
|
||||
import type {MarketLocationResponse} from '@/generated/mammon';
|
||||
|
||||
export type MarketLocation = MarketLocationResponse;
|
||||
|
||||
const cache = new Map<number, MarketLocation>();
|
||||
|
||||
export const searchMarketLocations = async (search: string): Promise<MarketLocation[]> => {
|
||||
if (search.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const locations = await universeApi.searchLocations(search).then(r => r.data);
|
||||
locations.forEach(l => cache.set(l.id, l));
|
||||
return locations;
|
||||
};
|
||||
Reference in New Issue
Block a user