MCPcopy Create free account
hub / github.com/SethGammon/Citadel / rank

Function rank

scripts/dashboard.js:302–310  ·  view source on GitHub ↗
(status)

Source from the content-addressed store, hash-verified

300 }
301
302 campaigns.sort((left, right) => {
303 const rank = (status) => {
304 if (status === 'active') return 0;
305 if (status === 'needs-review-package') return 1;
306 if (status === 'needs-completion') return 1;
307 if (status === 'needs-archive') return 1;
308 if (status.includes('approval') || status.includes('pending') || status === 'needs-continue') return 1;
309 if (status === 'parked' || status === 'paused') return 2;
310 return 3;
311 };
312 return rank(left.status) - rank(right.status) ||
313 new Date(right.modifiedAt).getTime() - new Date(left.modifiedAt).getTime();

Callers 1

readCampaignsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected