Migrated read APIs to Nitro
This commit is contained in:
1 parent
eb4e9f0700
commit
ee5809a489
26 files changed
+558
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { getQuery } from "h3"
|
||||
import { Artist } from "../../models/artist"
|
||||
import { requireAuthenticatedUser } from "../../utils/auth"
|
||||
import { parseMongoIds, validationResponse } from "../../utils/api-validation"
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
await requireAuthenticatedUser(event)
|
||||
|
||||
const parsedIds = parseMongoIds(getQuery(event).ids)
|
||||
if ("error" in parsedIds) return validationResponse(event, parsedIds.error)
|
||||
|
||||
return Artist.find({ _id: { $in: parsedIds.value } }).exec()
|
||||
})
|
||||
Reference in new issue
Block a user