Sync now includes tags

This commit is contained in:
2024-09-04 22:39:20 +02:00
parent 85c8fbae0f
commit 094f27d9ad
3 changed files with 50 additions and 33 deletions

View File

@@ -20,16 +20,13 @@ export default defineCachedEventHandler(async (e) => {
const where = ["project = $project", "tag = $tag"];
const criteria: Record<string, any> = { $project: project, $tag: tag };
if(where.length > 1)
const db = useDatabase();
const content = db.query(`SELECT * FROM explorer_tags WHERE ${where.join(" and ")}`).get(criteria) as Tag;
if(content !== undefined)
{
const db = useDatabase();
const content = db.query(`SELECT * FROM explorer_tags WHERE ${where.join(" and ")}`).get(criteria) as Tag;
if(content !== undefined)
{
return content;
}
return content;
}
setResponseStatus(e, 404);