Updating environments!

This commit is contained in:
Gregory Schier
2023-10-22 22:06:51 -07:00
parent 53d13c8172
commit c24f049dac
12 changed files with 155 additions and 52 deletions

View File

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