Sync FP submission lifecycle_status from Ivanti currentState on fetch

When GET /submissions enriches submissions with Ivanti API data, it now
checks if batch.currentState (APPROVED, REJECTED, REWORK) differs from
the local lifecycle_status and updates the DB accordingly. This ensures
approved submissions get filtered out of the queue panel as intended.

Also changed safeText() to return null for non-string Ivanti note values
(arrays/objects) instead of JSON-stringifying them. The notes array
filters nulls via .filter(Boolean) so non-string data is simply hidden.
This commit is contained in:
Jordan Ramos
2026-05-13 14:36:05 -06:00
parent 5126ccc6ae
commit 828e7cc45d
2 changed files with 17 additions and 1 deletions

View File

@@ -4090,7 +4090,7 @@ function FpEditModal({ open, onClose, submission, queueItems, onSuccess }) {
const safeText = (val) => {
if (!val) return null;
if (typeof val === 'string') return val;
try { return JSON.stringify(val); } catch { return String(val); }
return null;
};
const notes = [
safeText(submission.ivanti_rework_note) && { label: 'Rework Note', text: safeText(submission.ivanti_rework_note) },