mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 07:19:45 +02:00
A bunch of changes, including moving prompt/confirm out of context
This commit is contained in:
20
src-web/lib/setWorkspaceSearchParams.ts
Normal file
20
src-web/lib/setWorkspaceSearchParams.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { router } from './router.js';
|
||||
|
||||
/**
|
||||
* Setting search params using "from" on the global router instance in tanstack router does not
|
||||
* currently behave very well, so this is a wrapper function that gives a typesafe interface
|
||||
* for the same thing.
|
||||
*/
|
||||
export function setWorkspaceSearchParams(
|
||||
search: Partial<{
|
||||
cookie_jar_id: string | null;
|
||||
environment_id: string | null;
|
||||
request_id: string | null;
|
||||
}>,
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(router as any).navigate({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
search: (prev: any) => ({ ...prev, ...search }),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user