diff --git a/client/src/components/PostDetailPanel.jsx b/client/src/components/PostDetailPanel.jsx index 3e4cbcc..661d138 100644 --- a/client/src/components/PostDetailPanel.jsx +++ b/client/src/components/PostDetailPanel.jsx @@ -23,7 +23,6 @@ export default function PostDetailPanel({ post, onClose, onSave, onDelete, brand // Review state const [submittingReview, setSubmittingReview] = useState(false) - const [reviewUrl, setReviewUrl] = useState('') const [copied, setCopied] = useState(false) // Attachments state @@ -36,6 +35,7 @@ export default function PostDetailPanel({ post, onClose, onSave, onDelete, brand const postId = post?._id || post?.id const isCreateMode = !postId + const reviewUrl = post?.approval_token ? `${window.location.origin}/review-post/${post.approval_token}` : '' useEffect(() => { if (post) { @@ -149,8 +149,7 @@ export default function PostDetailPanel({ post, onClose, onSave, onDelete, brand if (dirty) await handleSave() setSubmittingReview(true) try { - const res = await api.post(`/posts/${postId}/submit-review`) - setReviewUrl(res.reviewUrl || '') + await api.post(`/posts/${postId}/submit-review`) setForm(f => ({ ...f, status: 'in_review' })) toast.success(t('posts.submittedForReview')) onSave(postId, {}) // reload parent