mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 10:23:11 +00:00
style(locations): format site query mapping
This commit is contained in:
parent
01d1795b66
commit
dffa30f27a
1 changed files with 7 additions and 9 deletions
|
|
@ -10,15 +10,13 @@ export function useLocationSites(search = ""): UseQueryResult<LocationOption[],
|
|||
queryKey: queryKeys.locations.sites(search),
|
||||
queryFn: async () => {
|
||||
const sites = await locationsApi.getSites(search || undefined);
|
||||
return sites.map(
|
||||
(site): LocationOption => ({
|
||||
id: site.id,
|
||||
name: formatLocationSiteLabel(site),
|
||||
siteCode: site.code,
|
||||
city: site.city,
|
||||
state: site.state,
|
||||
}),
|
||||
);
|
||||
return sites.map((site): LocationOption => ({
|
||||
id: site.id,
|
||||
name: formatLocationSiteLabel(site),
|
||||
siteCode: site.code,
|
||||
city: site.city,
|
||||
state: site.state,
|
||||
}));
|
||||
},
|
||||
staleTime: 5 * 60 * 1000,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue