mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-17 02:01:11 +10:00
feat: partial user platform support + statusMessage -> message
This commit is contained in:
@ -7,7 +7,7 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!userId)
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: "Requires authentication",
|
||||
message: "Requires authentication",
|
||||
});
|
||||
|
||||
const id = h3.context.params?.id;
|
||||
|
||||
@ -7,7 +7,7 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!userId)
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: "Requires authentication",
|
||||
message: "Requires authentication",
|
||||
});
|
||||
|
||||
const query = getQuery(h3);
|
||||
@ -15,13 +15,13 @@ export default defineEventHandler(async (h3) => {
|
||||
const orderBy = query.order as "asc" | "desc";
|
||||
if (orderBy) {
|
||||
if (typeof orderBy !== "string" || !["asc", "desc"].includes(orderBy))
|
||||
throw createError({ statusCode: 400, statusMessage: "Invalid order" });
|
||||
throw createError({ statusCode: 400, message: "Invalid order" });
|
||||
}
|
||||
|
||||
const tags = query.tags as string[] | undefined;
|
||||
if (tags) {
|
||||
if (typeof tags !== "object" || !Array.isArray(tags))
|
||||
throw createError({ statusCode: 400, statusMessage: "Invalid tags" });
|
||||
throw createError({ statusCode: 400, message: "Invalid tags" });
|
||||
}
|
||||
|
||||
const options = {
|
||||
|
||||
Reference in New Issue
Block a user