Files
hose-use/src/domains/contact/api.ts
T
gitea 68d570022d
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
feat: release v0.5.2 with protected contact domain and bill web link
2026-09-03 15:58:20 +08:00

15 lines
462 B
TypeScript

import { z } from "zod";
import type { KyInstance } from "ky";
import { StaffSchema, type Staff } from "./types.js";
export async function fetchStaffs(
client: KyInstance,
external: boolean = false
): Promise<Staff[]> {
const response = await client.get("api/easo/common/staffs", {
searchParams: { external: String(external) },
});
const json = (await response.json()) as { data: unknown };
return z.array(StaffSchema).parse(json.data ?? []);
}