import { memberSettings, Member, MemberLight, MemberCardDetails } from "@shared/types/member";
import { Unit } from "@shared/types/units";

//  @ts-ignore
const addr = import.meta.env.VITE_APIHOST;

export async function getUnits(): Promise<Unit[]> {
    const response = await fetch(`${addr}/units`, {
        credentials: 'include'
    });
    if (!response.ok) {
        throw new Error("Failed to fetch units");
    }
    return response.json();
}