File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ const updateQuery = async ({
8484/** Debounced version of `updateQuery`. */
8585const updateQueryDebounced = debounce (updateQuery , 500 )
8686
87+ // Watch for search changes and reset page to 1 to avoid loading non-existent pages
88+ watch (search , () => {
89+ page .value = 1
90+ })
91+
8792// Watch for any error and emit a message on any error.
8893watch (
8994 () => caseListRes .isError ,
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ export const useCaseListQuery = ({
5656 order_by : ( ) => toValue ( orderBy ) ?? 'name' ,
5757 // @ts -ignore // https://github.com/hey-api/openapi-ts/issues/653#issuecomment-2314847011
5858 order_dir : ( ) => toValue ( orderDir ) ?? 'asc' ,
59- q : toValue ( queryString ) ,
59+ // @ts -ignore // https://github.com/hey-api/openapi-ts/issues/653#issuecomment-2314847011
60+ q : ( ) => toValue ( queryString ) ,
6061 } ,
6162 } ) ,
6263 // @ts -ignore // https://github.com/hey-api/openapi-ts/issues/653#issuecomment-2314847011
@@ -87,7 +88,7 @@ export const useCaseCountQuery = ({
8788 } ,
8889 query : {
8990 // @ts -ignore // https://github.com/hey-api/openapi-ts/issues/653#issuecomment-2314847011
90- q : queryString ,
91+ q : ( ) => toValue ( queryString ) ,
9192 } ,
9293 } ) ,
9394 enabled : ( ) => ! ! toValue ( projectUuid ) ,
You can’t perform that action at this time.
0 commit comments