You've already forked obsidian-visualiser
Add insertion and deletion of tables for db sync, and user view
This commit is contained in:
16
server/api/users/[id]/comments.get.ts
Normal file
16
server/api/users/[id]/comments.get.ts
Normal 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[];
|
||||
});
|
||||
Reference in New Issue
Block a user