import { apiGet, apiPost } from "@/app/lib/clientApi"; import type { AdminLocationNode, LocationInvoiceHeaderUploadResult } from "@/app/lib/types"; /** The flat location_hierarchy node list (see AdminLocationNode) — used by * pickers such as UserForm's Branch select, which filters to type "B". */ export async function listAdminLocations(): Promise { return apiGet("/api/locations"); } /** * Uploads a location invoice-header image (upload-on-submit): the mobile-api upload is * SAME-REQUEST (file_autocommit=Y), so the returned public URL can be persisted in * `documentHeaderPath` immediately. */ export async function uploadInvoiceHeaderImage(input: { fileName: string; fileType: string; base: string; }): Promise { return apiPost("/api/locations/invoice-header", input); }