this repo has no description
1import type { CachetUser } from "../types";
2
3/**
4 * Fetches user information from Cachet API
5 */
6export async function getCachetUser(
7 userId: string,
8): Promise<CachetUser | null> {
9 try {
10 const response = await fetch(`https://cachet.dunkirk.sh/users/${userId}`, {
11 tls: { rejectUnauthorized: false },
12 });
13 if (response.ok) {
14 return (await response.json()) as CachetUser;
15 }
16 return null;
17 } catch (error) {
18 console.error(`Error fetching user ${userId} from cachet:`, error);
19 return null;
20 }
21}