Nested sidebar ordering almost working

This commit is contained in:
Gregory Schier
2023-11-03 14:08:46 -07:00
parent 30e1ecac39
commit 867f3908ed
5 changed files with 220 additions and 110 deletions

View File

@@ -1,5 +1,5 @@
import { invoke } from '@tauri-apps/api';
import type { Environment, HttpRequest, Workspace } from './models';
import type { Environment, Folder, HttpRequest, Workspace } from './models';
export async function getRequest(id: string | null): Promise<HttpRequest | null> {
if (id === null) return null;
@@ -19,6 +19,15 @@ export async function getEnvironment(id: string | null): Promise<Environment | n
return environment;
}
export async function getFolder(id: string | null): Promise<Folder | null> {
if (id === null) return null;
const folder: Folder = (await invoke('get_folder', { id })) ?? null;
if (folder == null) {
return null;
}
return folder;
}
export async function getWorkspace(id: string | null): Promise<Workspace | null> {
if (id === null) return null;
const workspace: Workspace = (await invoke('get_workspace', { id })) ?? null;