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:
2026-10-27 21:52:37 +03:30
co-authored by Cursor
parent 1d3588a69d
commit f15c5b9141
2 changed files with 213 additions and 11 deletions
+5 -4
View File
@@ -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"