duelfi/src/shared/data_fetcher.ts
2025-04-15 11:04:49 +05:30

9 lines
238 B
TypeScript

import { API_URL } from "@/data/shared";
export async function fetchUserById(id: string) {
const url = `${API_URL}get_user_by_id.php?id=${id}`;
const res = await fetch(url);
if (!res.ok) return null;
return await res.json();
}