squash: AdenMGB collection design & backend work

Update index.post.ts to implement saving collections functionality

Update index.get.ts to verify if collection exists and if user can access it

Update index.delete.ts to ask questions and not be so nonchalant

Update entry.post.ts

Update entry.delete.ts to do it better

Update index.vue to add functionality to the add to library button + fidgit with image

Update index.vue to also add add to library functionality, but no fidget :(

Update entry.post.ts to infact not remove it

Update index.ts

Update index.vue to manage collections from store page

Update index.ts to restrut for ahhhh

Update index.vue too add collection control to carosel

Update index.vue fix minor issue

Update index.vue to fix dropdown modal bug

Create library.vue for page layout

Create index.vue for library game details pane

Create index.vue for viewing collections pane

Create DeleteCollectionModal.vue component

Create CreateCollectionModal.vue component

Update AddLibraryButton.vue with dropdown :D

Update index.vue to use new components

Update index.vue for more components :O

Update entry.post.ts to not not return success, it'll figure it out

Update entry.delete.ts to not return...
This commit is contained in:
Aden Lindsay
2025-01-27 11:15:09 +10:30
committed by DecDuck
parent 892f64fe3a
commit eea8f82bf9
16 changed files with 1844 additions and 97 deletions

View File

@ -16,11 +16,26 @@ export default defineEventHandler(async (h3) => {
});
const body = await readBody(h3);
const gameId = body.id;
if (!gameId)
throw createError({ statusCode: 400, statusMessage: "Game ID required" });
await userLibraryManager.collectionRemove(id, gameId);
// Verify collection exists and user owns it
const collection = await userLibraryManager.fetchCollection(id);
if (!collection) {
throw createError({
statusCode: 404,
statusMessage: "Collection not found",
});
}
if (collection.userId !== userId) {
throw createError({
statusCode: 403,
statusMessage: "Not authorized to modify this collection",
});
}
const removed = await userLibraryManager.collectionRemove(gameId, id);
return {};
});