2023-06-26 17:33:40 -05:00
|
|
|
import { toast } from "react-hot-toast";
|
|
|
|
|
2023-06-09 17:31:14 -05:00
|
|
|
export default async function getPublicUserDataByEmail(email: string) {
|
2023-04-28 16:10:29 -05:00
|
|
|
const response = await fetch(`/api/routes/users?email=${email}`);
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
2023-06-26 17:33:40 -05:00
|
|
|
if (!response.ok) toast.error(data.response);
|
2023-05-22 23:08:16 -05:00
|
|
|
|
2023-04-28 16:10:29 -05:00
|
|
|
return data.response;
|
|
|
|
}
|