feat(activities): add photos when registering a follow-up comment
A later comment can attach photos with the same compressor, and they stay on the activity note. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -242,8 +242,8 @@ async function postponeTo(iso: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function submitComment(text: string) {
|
||||
const body = text.trim();
|
||||
async function submitComment(payload: { text: string; photoOnly: boolean }) {
|
||||
const body = payload.text.trim() || (payload.photoOnly ? 'عکس پیوست شد.' : '');
|
||||
if (!id.value || !activity.value || !body) return;
|
||||
saving.value = true;
|
||||
error.value = '';
|
||||
@@ -257,8 +257,9 @@ async function submitComment(text: string) {
|
||||
await api.patch(`/activities/${id.value}`, { description: next });
|
||||
commentOpen.value = false;
|
||||
await load();
|
||||
} catch {
|
||||
} catch (e) {
|
||||
error.value = 'ثبت نظر ناموفق بود.';
|
||||
throw e;
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
@@ -488,8 +489,8 @@ onMounted(() => {
|
||||
v-if="commentOpen"
|
||||
:activity="activity"
|
||||
:saving="saving"
|
||||
:save="submitComment"
|
||||
@close="commentOpen = false"
|
||||
@submit="submitComment"
|
||||
/>
|
||||
<ActivityPostponeSheet
|
||||
v-if="postponeOpen"
|
||||
|
||||
Reference in New Issue
Block a user