mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-14 04:49:40 +02:00
Updating environments!
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user