From 8e5566a5a3449629517053dceb616a069ef614bd Mon Sep 17 00:00:00 2001 From: David Plugge Date: Wed, 31 Jan 2024 16:12:42 +0100 Subject: [PATCH] fix sort param parsing --- src/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index 59d1bb3..8748976 100644 --- a/src/client.ts +++ b/src/client.ts @@ -181,10 +181,10 @@ export class TypedRecordService if (fields) options.fields = fields; if (expand) options.expand = expand; - if (sort) { - options.sort = Array.isArray(options?.sort) - ? options.sort.join(',') - : options?.sort; + if (Array.isArray(sort) && sort.length) { + options.sort = sort.join(','); + } else if (sort) { + options.sort = sort; } return options;