update ui and remove mock data
This commit is contained in:
17
src/features/stores/hooks/useSites.ts
Normal file
17
src/features/stores/hooks/useSites.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
import {useResource} from '@/shared/hooks/useResource';
|
||||
import {siteRepository} from '@/features/stores/repositories/siteRepository';
|
||||
import type {Site} from '@/features/stores/types/site';
|
||||
import type {Resource} from '@/shared/hooks/useResource';
|
||||
|
||||
/**
|
||||
* The estate, from the platform.
|
||||
*
|
||||
* Unscoped on purpose — the site list is what the scope selector is FOR, so it
|
||||
* cannot itself be filtered by the selection. That also means one fetch per
|
||||
* session rather than one per store change.
|
||||
*/
|
||||
export function useSites(): Resource<Site[]> {
|
||||
return useResource(siteRepository.list());
|
||||
}
|
||||
Reference in New Issue
Block a user