This commit is contained in:
@ -218,7 +218,7 @@ function followupRowHTML(c) {
|
||||
<td>${c.daysSinceLastActivity != null ? c.daysSinceLastActivity : '—'}</td>
|
||||
<td class="followup-note-cell">
|
||||
<textarea class="followup-note-input" rows="2" data-client="${code}"
|
||||
placeholder="Follow-up note…">${esc(c.note || '')}</textarea>
|
||||
maxlength="200" placeholder="Follow-up note…">${esc(c.note || '')}</textarea>
|
||||
<div class="followup-note-actions">
|
||||
<button type="button" class="btn btn-sm btn-primary save-note-btn" data-client="${code}">Save note</button>
|
||||
</div>
|
||||
@ -282,10 +282,17 @@ async function archiveFromFollowup(clientCode) {
|
||||
|
||||
async function saveNote(clientCode, ta) {
|
||||
if (!ta) return;
|
||||
const note = ta.value.trim();
|
||||
if (note.length > 200) {
|
||||
showToast('Note must be at most 200 characters', 'error');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await apiPut('analytics.php', { clientCode, note: ta.value.trim() });
|
||||
const res = await apiPut('analytics.php', { clientCode, note });
|
||||
const saved = res?.note ?? note;
|
||||
ta.value = saved;
|
||||
const row = staleClients.find(c => c.clientCode === clientCode);
|
||||
if (row) row.note = ta.value.trim();
|
||||
if (row) row.note = saved;
|
||||
showToast('Note saved', 'success');
|
||||
} catch (e) {
|
||||
showToast(e.message, 'error');
|
||||
|
||||
Reference in New Issue
Block a user