Rename workspace

This commit is contained in:
Gregory Schier
2023-04-09 12:23:41 -07:00
parent 1b6cfbac77
commit f66dcb9267
20 changed files with 275 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import { invoke } from '@tauri-apps/api';
import type { HttpRequest } from './models';
import type { HttpRequest, Workspace } from './models';
export async function getRequest(id: string | null): Promise<HttpRequest | null> {
if (id === null) return null;
@@ -9,3 +9,12 @@ export async function getRequest(id: string | null): Promise<HttpRequest | null>
}
return request;
}
export async function getWorkspace(id: string | null): Promise<Workspace | null> {
if (id === null) return null;
const workspace: Workspace = (await invoke('get_workspace', { id })) ?? null;
if (workspace == null) {
return null;
}
return workspace;
}