2023-07-17 22:31:26 -05:00
|
|
|
import { toast } from "react-hot-toast";
|
|
|
|
|
2023-10-22 23:28:39 -05:00
|
|
|
export default async function getPublicUserData(id: number | string) {
|
2023-11-06 07:25:57 -06:00
|
|
|
const response = await fetch(`/api/v1/public/users/${id}`);
|
2023-07-17 22:31:26 -05:00
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
|
|
|
if (!response.ok) toast.error(data.response);
|
|
|
|
|
|
|
|
return data.response;
|
|
|
|
}
|