Add auth checks for user routes and dashboard state
Some checks failed
Deploy to Production / test (push) Failing after 33s
Some checks failed
Deploy to Production / test (push) Failing after 33s
- tighten route authorization and schema handling - update user route tests and server coverage - refresh player dashboard behavior
This commit is contained in:
@@ -30,7 +30,7 @@ export default function PlayerDashboard({ userId }: { userId: string }) {
|
||||
useEffect(() => {
|
||||
async function load() {
|
||||
try {
|
||||
const userData = await get<UserData>(`/api/users/${userId}`);
|
||||
const userData = await get<UserData>("/api/me");
|
||||
setUser(userData);
|
||||
} catch {
|
||||
setError("Failed to load profile");
|
||||
@@ -39,7 +39,7 @@ export default function PlayerDashboard({ userId }: { userId: string }) {
|
||||
}
|
||||
|
||||
try {
|
||||
const data = await get<{ inventory: InventoryEntry[] }>(`/api/users/${userId}/inventory`);
|
||||
const data = await get<{ inventory: InventoryEntry[] }>("/api/me/inventory");
|
||||
setInventory(data.inventory ?? []);
|
||||
} catch {
|
||||
setInventoryError(true);
|
||||
|
||||
Reference in New Issue
Block a user