Files
twenty/packages/twenty-server/src/utils/date/toIsoStringOrNull.ts
T
neo773 7dfc556250 refactor messaging jobs (#19626)
Cleans up the code quality by migrating from Raw SQL to TypeORM
entities. The previous implementation was necessary to do cross‑schema
table joins but since we've migrated to the core schema we don't need it
anymore.

- Also extracted `toIsoStringOrNull` to a utility it was duplicated
several times
- Moved `isThrottled` logic from job handler to cron enqueuer
2026-04-13 14:39:52 +00:00

10 lines
210 B
TypeScript

export const toIsoStringOrNull = (
value: string | Date | null | undefined,
): string | null => {
if (value == null) {
return null;
}
return value instanceof Date ? value.toISOString() : value;
};