Files
twenty/packages/twenty-front/src/utils/turnOrderByIntoSort.ts
T
Thomas Trompette 3acc87a620 [SSE] Add backend for SSE subscriptions (#17022)
- moved a few gql types to twenty shared to re-use in server
- added a new endpoint, onEventSubscription that expect a streamId to
create a connection
- two new endpoints to store queries in Redis
- updated the existing batch channel to directly use object record type
2026-01-10 14:44:02 +00:00

13 lines
415 B
TypeScript

import { type OrderBy } from 'twenty-shared/types';
import { assertUnreachable } from 'twenty-shared/utils';
export const turnOrderByIntoSort = (orderBy: OrderBy): 'asc' | 'desc' => {
if (orderBy === 'AscNullsFirst' || orderBy === 'AscNullsLast') {
return 'asc';
} else if (orderBy === 'DescNullsFirst' || orderBy === 'DescNullsLast') {
return 'desc';
} else {
assertUnreachable(orderBy);
}
};