main stocks update
This commit is contained in:
@@ -757,7 +757,12 @@ export function useFiestaGetStockRequests(opts: {
|
||||
return useQuery({
|
||||
queryKey: fiestaKeys.stockRequests(opts),
|
||||
queryFn: () => getStockRequests(opts),
|
||||
enabled: Boolean(opts.tenantid),
|
||||
// Omitting locationid is a deliberate tenant-wide query (the admin console
|
||||
// needs every outlet's requests). But passing an EMPTY one is not: the
|
||||
// backend treats locationid=0 as "no filter" and returns every outlet, so a
|
||||
// store user whose outlet hasn't resolved yet would see other stores'
|
||||
// requests. Wait for a real id in that case.
|
||||
enabled: Boolean(opts.tenantid) && (opts.locationid === undefined || Boolean(opts.locationid)),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user