collection owner is now visible to other users
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { toast } from "react-hot-toast";
|
||||
|
||||
export default async function getPublicUserData({
|
||||
username,
|
||||
id,
|
||||
}: {
|
||||
username?: string;
|
||||
id?: number;
|
||||
}) {
|
||||
const response = await fetch(
|
||||
`/api/routes/users?id=${id}&${
|
||||
username ? `username=${username?.toLowerCase()}` : undefined
|
||||
}`
|
||||
);
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) toast.error(data.response);
|
||||
|
||||
return data.response;
|
||||
}
|
||||
Reference in New Issue
Block a user