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:
@@ -37,7 +37,7 @@ export namespace Cms {
|
||||
parentIds?: string[];
|
||||
language?: string | undefined;
|
||||
sortDirection?: 'asc' | 'desc';
|
||||
sortBy?: 'publishedAt' | 'order';
|
||||
sortBy?: 'publishedAt' | 'order' | 'title' | 'slug';
|
||||
}
|
||||
|
||||
export interface GetCategoriesOptions {
|
||||
|
||||
@@ -41,7 +41,11 @@ class WordpressClient implements CmsClient {
|
||||
}
|
||||
|
||||
if (options.sortBy) {
|
||||
queryParams.append('orderby', options.sortBy);
|
||||
const sortBy = mapSortByParam(options.sortBy);
|
||||
|
||||
if (sortBy) {
|
||||
queryParams.append('orderby', sortBy);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user