Skip to content

Commit

Permalink
combined the check for no query string and undefined assetmappinglist…
Browse files Browse the repository at this point in the history
… in single if statement
  • Loading branch information
pramodcog committed Aug 22, 2024
1 parent 85a4023 commit d13ebdb
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ export const useSearchMappedEquipmentAssetMappings = (
...models.map((model) => [model.modelId, model.revisionId])
],
queryFn: async ({ pageParam }: { pageParam: string | undefined }) => {
if (query === '') {
return { assets: [], nextCursor: undefined };
}
if (assetMappingList === undefined) {
if (query === '' || assetMappingList === undefined) {
return { assets: [], nextCursor: undefined };
}

const fetchAssets = async (
cursor: string | undefined,
accumulatedAssets: Asset[]
Expand Down

0 comments on commit d13ebdb

Please sign in to comment.