3acc87a620
- 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
13 lines
415 B
TypeScript
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);
|
|
}
|
|
};
|