Update several package dependencies

Several dependencies across multiple packages have been updated to their later versions. This includes updates to 'lucide-react', '@lemonsqueezy/lemonsqueezy.js', 'supabase' and 'eslint-config-turbo'. The lock file has been updated to reflect these changes.
This commit is contained in:
gbuomprisco
2024-06-15 11:23:09 +08:00
parent 6e362a73af
commit f56e2b83b9
2 changed files with 21 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ export namespace Cms {
parentIds?: string[]; parentIds?: string[];
language?: string | undefined; language?: string | undefined;
sortDirection?: 'asc' | 'desc'; sortDirection?: 'asc' | 'desc';
sortBy?: 'publishedAt' | 'order'; sortBy?: 'publishedAt' | 'order' | 'title' | 'slug';
} }
export interface GetCategoriesOptions { export interface GetCategoriesOptions {

View File

@@ -41,7 +41,11 @@ class WordpressClient implements CmsClient {
} }
if (options.sortBy) { if (options.sortBy) {
queryParams.append('orderby', options.sortBy); const sortBy = mapSortByParam(options.sortBy);
if (sortBy) {
queryParams.append('orderby', sortBy);
}
} }
if (options.sortDirection) { if (options.sortDirection) {
@@ -351,3 +355,18 @@ class WordpressClient implements CmsClient {
: ''; : '';
} }
} }
function mapSortByParam(sortBy: string) {
switch (sortBy) {
case 'publishedAt':
return 'date';
case 'title':
return 'title';
case 'slug':
return 'slug';
case 'order':
return 'menu_order';
default:
return;
}
}