refactor: rename variables and create hooks

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe
2024-05-08 08:38:44 +07:00
parent a41b3e565f
commit be494b489c
3 changed files with 62 additions and 51 deletions

View File

@@ -82,11 +82,11 @@ const constructFilterInput = (filters: {
}
if (filters[`${PRICE_FILTER_ID}.max`]) {
price.max = Number(filters[`${PRICE_FILTER_ID}.max`]);
!price.min && (price.min = 0);
}
if (price.max && !price.min) {
price.min = 0;
if (price.max || price.min) {
results.push({ price });
}
results.push({ price });
return results;
};