-
Yusuf Akgül authoredYusuf Akgül authored
get-users.ts 265 B
export const getUsers = async (id?: string) => {
try {
const data = await fetch(`/api/users${id ? `?id=${id}` : ""}`)
.then((result) => result.json())
return data
} catch (error: any) {
return error.response.data
}
}