diff --git a/src/App.js b/src/App.js index 8bd76d4..d1bfff8 100644 --- a/src/App.js +++ b/src/App.js @@ -2377,8 +2377,12 @@ function AdminView({ userId }) { }) ); - // newest first by createdAt (fallback to name for stable order). + // sort by order field (fallback createdAt) detailedCampaigns.sort((a, b) => { + const ao = a.order ?? null, bo = b.order ?? null; + if (ao !== null && bo !== null) return ao - bo; + if (ao !== null) return -1; + if (bo !== null) return 1; const at = a.createdAt || 0; const bt = b.createdAt || 0; if (at === bt) return (a.name || '').localeCompare(b.name || '');