Fix boolean param bug

This commit is contained in:
marzban-dev
2026-05-02 18:46:58 +03:30
parent 83b368102d
commit b1173ea80e
3 changed files with 15 additions and 11 deletions
+11 -3
View File
@@ -36,12 +36,20 @@ export const useAppParams = () => {
mode: "replace",
});
const in_stock = useRouteQuery<string>("in_stock", "false", {
const in_stock = useRouteQuery("in_stock", "false", {
mode: "replace",
transform: {
get: (v) => v === "true",
set: (v: boolean) => (v ? "true" : "false"),
},
});
const has_discount = useRouteQuery<string>("has_discount", "false", {
const has_discount = useRouteQuery("has_discount", "false", {
mode: "replace",
transform: {
get: (v) => v === "true",
set: (v: boolean) => (v ? "true" : "false"),
},
});
const tracking_code = useRouteQuery<string>("tracking_code", "", {
@@ -52,7 +60,7 @@ export const useAppParams = () => {
() => page.value,
() => {
y.value = 0;
}
},
);
return {