collection owner is now visible to other users

This commit is contained in:
Daniel
2023-07-17 23:31:26 -04:00
parent 46cca3cff3
commit 78f3d449bc
6 changed files with 100 additions and 28 deletions
+21
View File
@@ -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;
}