mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 02:41:07 +01:00
Add sidebar action to select the active request
This commit is contained in:
@@ -83,6 +83,17 @@ export function getModel<M extends AnyModel['model'], T extends ExtractModel<Any
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getAnyModel(
|
||||
id: string,
|
||||
): AnyModel | null {
|
||||
let data = mustStore().get(modelStoreDataAtom);
|
||||
for (const t of Object.keys(data)) {
|
||||
let v = (data as any)[t]?.[id];
|
||||
if (v?.model === t) return v;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function patchModelById<M extends AnyModel['model'], T extends ExtractModel<AnyModel, M>>(
|
||||
model: M,
|
||||
id: string,
|
||||
|
||||
Reference in New Issue
Block a user