mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-16 01:31:19 +10:00
feat: refactor & redesign parts of UI
This commit is contained in:
@ -13,18 +13,7 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!gameId)
|
||||
throw createError({ statusCode: 400, statusMessage: "Game ID required" });
|
||||
|
||||
// Get the default collection for this user
|
||||
const collections = await userLibraryManager.fetchCollections(userId);
|
||||
const defaultCollection = collections.find(c => c.isDefault);
|
||||
|
||||
if (!defaultCollection) {
|
||||
throw createError({
|
||||
statusCode: 404,
|
||||
statusMessage: "Default collection not found",
|
||||
});
|
||||
}
|
||||
|
||||
// Add the game to the default collection
|
||||
await userLibraryManager.collectionAdd(gameId, defaultCollection.id);
|
||||
await userLibraryManager.libraryAdd(gameId, userId);
|
||||
return {};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user