From 3adcfdacf521d664abb12fd8ac59f7f051d26f6b Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 19 Jun 2025 19:58:40 +0900 Subject: [PATCH] fix post commnet --- oauth/src/components/CommentForm.jsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/oauth/src/components/CommentForm.jsx b/oauth/src/components/CommentForm.jsx index 2f7133d..96f5561 100644 --- a/oauth/src/components/CommentForm.jsx +++ b/oauth/src/components/CommentForm.jsx @@ -46,8 +46,13 @@ export default function CommentForm({ user, agent, onCommentPosted }) { } } - // Post the record - await atproto.putRecord(null, record, agent) + // Post the record using the same API as ask-AI + await agent.api.com.atproto.repo.putRecord({ + repo: record.repo, + collection: record.collection, + rkey: record.rkey, + record: record.record + }) // キャッシュを無効化 collections.invalidateCache(env.collection) @@ -59,6 +64,12 @@ export default function CommentForm({ user, agent, onCommentPosted }) { if (onCommentPosted) { onCommentPosted() } + + // Show success message briefly + setText('✓ コメントが投稿されました') + setTimeout(() => { + setText('') + }, 2000) } catch (err) { setError(err.message) @@ -112,7 +123,7 @@ export default function CommentForm({ user, agent, onCommentPosted }) {