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
+3 -3
View File
@@ -15,16 +15,16 @@ type AccountStore = {
const useAccountStore = create<AccountStore>()((set) => ({
account: {} as AccountSettings,
setAccount: async (id) => {
const response = await fetch(`/api/users?id=${id}`);
const response = await fetch(`/api/v1/users/${id}`);
const data = await response.json();
const profilePic = `/api/avatar/${data.response.id}?${Date.now()}`;
const profilePic = `/api/v1/avatar/${data.response.id}?${Date.now()}`;
if (response.ok) set({ account: { ...data.response, profilePic } });
},
updateAccount: async (user) => {
const response = await fetch("/api/users", {
const response = await fetch(`/api/v1/users/${user.id}`, {
method: "PUT",
body: JSON.stringify(user),
headers: {