mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
12 lines
335 B
TypeScript
12 lines
335 B
TypeScript
export default defineEventHandler(async (h3) => {
|
|
const query = getQuery(h3);
|
|
const search = query["q"]?.toString();
|
|
if (!search) throw createError({
|
|
statusCode: 400,
|
|
statusMessage: "Missing search param"
|
|
});
|
|
|
|
const results = await h3.context.metadataHandler.search(search);
|
|
|
|
return results;
|
|
}); |