Files
DatBrowser/resources/js/lib/utils.ts
Matthias Guillitte 4a6a36ba33
All checks were successful
Push image to registry / build-image (push) Successful in 3m39s
Oopsie
2025-02-07 15:05:23 +01:00

17 lines
411 B
TypeScript

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export async function httpApi<T>(route: string): Promise<T> {
let response = await fetch("/api" + route);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
}