2
0
mirror of https://github.com/frappe/books.git synced 2025-01-09 01:44:15 +00:00
books/main/api.ts
2024-12-05 21:28:38 +05:30

11 lines
267 B
TypeScript

import fetch, { RequestInit } from 'node-fetch';
export async function sendAPIRequest(
endpoint: string,
options: RequestInit | undefined
) {
return (await fetch(endpoint, options)).json() as unknown as {
[key: string]: string | number | boolean;
}[];
}