catalog: accept null as field value
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -295,7 +295,7 @@ export type Cursor = {
|
||||
/**
|
||||
* The values of the fields of a specific item used for paginating the data.
|
||||
*/
|
||||
sortFieldValues: string[];
|
||||
sortFieldValues: Array<string | null>;
|
||||
/**
|
||||
* A filter to be applied to the full list of entities.
|
||||
*/
|
||||
@@ -313,7 +313,7 @@ export type Cursor = {
|
||||
* The catalog uses this field internally to understand if the beginning
|
||||
* of the list has been reached when performing cursor based pagination.
|
||||
*/
|
||||
firstSortFieldValues?: string[];
|
||||
firstSortFieldValues?: Array<string | null>;
|
||||
/**
|
||||
* The number of items that match the provided filters
|
||||
*/
|
||||
|
||||
@@ -338,7 +338,7 @@ export class DefaultEntitiesCatalog implements EntitiesCatalog {
|
||||
const limit = request?.limit ?? 20;
|
||||
|
||||
const cursor: Omit<Cursor, 'sortFieldValues'> & {
|
||||
sortFieldValues?: string[];
|
||||
sortFieldValues?: (string | null)[];
|
||||
} = {
|
||||
sortFields: [defaultSortField],
|
||||
isPrevious: false,
|
||||
@@ -689,5 +689,5 @@ function invertOrder(order: EntitySortField['order']) {
|
||||
}
|
||||
|
||||
function sortFieldsFromRow(row: DbSearchRow) {
|
||||
return [row.value!, row.entity_id];
|
||||
return [row.value, row.entity_id];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user