completionId: cgen-aca48a29e75d4be1a5c0993e45ad2c46
cgen-aca48a29e75d4be1a5c0993e45ad2c46
This commit is contained in:
parent
cf30c1b6eb
commit
1de2403ba4
1 changed files with 7 additions and 0 deletions
|
|
@ -2883,6 +2883,13 @@ export function createServer() {
|
|||
if (!user_id || !content)
|
||||
return res.status(400).json({ error: "user_id and content required" });
|
||||
try {
|
||||
// Get post author info
|
||||
const { data: post } = await adminSupabase
|
||||
.from("community_posts")
|
||||
.select("user_id")
|
||||
.eq("id", postId)
|
||||
.single();
|
||||
|
||||
const { data, error } = await adminSupabase
|
||||
.from("community_comments")
|
||||
.insert({ post_id: postId, user_id, content } as any)
|
||||
|
|
|
|||
Loading…
Reference in a new issue