refactored/cleaned up API + added support for renaming tags

This commit is contained in:
daniel31x13
2023-10-23 00:28:39 -04:00
parent 24cced9dba
commit ed24685aaf
48 changed files with 603 additions and 305 deletions
+2 -12
View File
@@ -1,17 +1,7 @@
import { toast } from "react-hot-toast";
export default async function getPublicUserData({
username,
id,
}: {
username?: string;
id?: number;
}) {
const response = await fetch(
`/api/users?id=${id}&${
username ? `username=${username?.toLowerCase()}` : undefined
}`
);
export default async function getPublicUserData(id: number | string) {
const response = await fetch(`/api/v1/users/${id}`);
const data = await response.json();