// src/api/user/getUser.ts import instance from "../axiosInstance" import type { UserProfile } from "../../models/user/UserProfile" import { endpoints } from "@shared/contracts" const { users } = endpoints export async function getUser(userName: string): Promise { try { const { data } = await instance.get(`/user/${userName}`) return users.userProfileResponseSchema.parse(data) } catch (err: any) { console.error("Kullanıcı bilgileri alınamadı:", err) throw new Error( err.response?.data?.message || "Kullanıcı bilgileri alınamadı" ) } }