mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-18 02:31:19 +10:00
feat: partial user platform support + statusMessage -> message
This commit is contained in:
@ -6,14 +6,14 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!userId)
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: "Requires authentication",
|
||||
message: "Requires authentication",
|
||||
});
|
||||
|
||||
const id = getRouterParam(h3, "id");
|
||||
if (!id)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "ID required in route params",
|
||||
message: "ID required in route params",
|
||||
});
|
||||
|
||||
// Fetch specific collection
|
||||
@ -22,14 +22,14 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!collection)
|
||||
throw createError({
|
||||
statusCode: 404,
|
||||
statusMessage: "Collection not found",
|
||||
message: "Collection not found",
|
||||
});
|
||||
|
||||
// Verify user owns this collection
|
||||
if (collection.userId !== userId)
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: "Not authorized to access this collection",
|
||||
message: "Not authorized to access this collection",
|
||||
});
|
||||
|
||||
return collection;
|
||||
|
||||
Reference in New Issue
Block a user