feat: implement settings layout and navigation, add tag and thought pages with API integration

This commit is contained in:
2025-09-06 21:56:41 +02:00
parent 5344e0d6a8
commit 85e3425d4b
9 changed files with 257 additions and 18 deletions

View File

@@ -192,4 +192,20 @@ export const updateProfile = (
},
UserSchema, // Expect the updated user object back
token
);
export const getThoughtsByTag = (tagName: string, token: string | null) =>
apiFetch(
`/tags/${tagName}`,
{},
z.object({ thoughts: z.array(ThoughtSchema) }),
token
);
export const getThoughtById = (thoughtId: string, token: string | null) =>
apiFetch(
`/thoughts/${thoughtId}`,
{},
ThoughtSchema, // Expect a single thought object
token
);