mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 16:23:25 +01:00
12 lines
347 B
TypeScript
12 lines
347 B
TypeScript
import { invoke } from '@tauri-apps/api';
|
|
import type { HttpRequest } from './models';
|
|
|
|
export async function getRequest(id: string | null): Promise<HttpRequest | null> {
|
|
if (id === null) return null;
|
|
const request: HttpRequest = (await invoke('get_request', { id })) ?? null;
|
|
if (request == null) {
|
|
return null;
|
|
}
|
|
return request;
|
|
}
|