Update getContentItems to return total count and items

The changes involved modifying the implementation of `getContentItems` across multiple files, specifically in the CMS-related codebase. This method now returns an object containing the total count of items and the items themselves. The updates also included necessary adjustments in the code where `getContentItems` is called to accommodate the new structure of the returned result.
This commit is contained in:
giancarlo
2024-04-10 16:29:19 +08:00
parent 44373c0372
commit f94557e333
8 changed files with 89 additions and 71 deletions

View File

@@ -59,9 +59,10 @@ export abstract class CmsClient {
* @param options - Options for filtering and pagination.
* @returns A promise that resolves to an array of content items.
*/
abstract getContentItems(
options?: Cms.GetContentItemsOptions,
): Promise<Cms.ContentItem[]>;
abstract getContentItems(options?: Cms.GetContentItemsOptions): Promise<{
total: number;
items: Cms.ContentItem[];
}>;
/**
* Retrieves a content item by its ID and type.