Add insertion and deletion of tables for db sync, and user view

This commit is contained in:
2024-09-10 14:25:23 +02:00
parent fa1a13d411
commit e904f28b3b
14 changed files with 127 additions and 23 deletions

View File

@@ -0,0 +1,16 @@
import useDatabase from "~/composables/useDatabase";
import type { Comment } from "~/types/auth";
export default defineEventHandler((e) => {
const id = getRouterParam(e, 'id');
if(!id)
{
setResponseStatus(e, 400);
return;
}
const db = useDatabase();
return db.query(`SELECT * FROM explorer_comments WHERE user_id = ?1`).all(id) as Comment[];
});