Skip to content

Commit 00a45fa

Browse files
committed
fix(content type schema list): removing option to sort content type schemas
1 parent b1bf7dd commit 00a45fa

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

src/commands/content-type-schema/list.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ describe('content-type-schema list command', (): void => {
2727
hubId: 'hub-id'
2828
};
2929

30-
it('should pass the sort data into the service', async (): Promise<void> => {
31-
const pagingOptions = { sort: 'createdDate,desc' };
32-
30+
it('should pass the list data into the service', async (): Promise<void> => {
3331
const plainListContentTypeSchemas = [
3432
{
3533
id: '1',
@@ -63,11 +61,11 @@ describe('content-type-schema list command', (): void => {
6361
}
6462
});
6563

66-
const argv = { ...yargArgs, ...config, ...pagingOptions };
64+
const argv = { ...yargArgs, ...config };
6765
await handler(argv);
6866

6967
expect(mockGetHub).toBeCalledWith('hub-id');
70-
expect(mockList).toBeCalledWith({ size: DEFAULT_SIZE, ...pagingOptions });
68+
expect(mockList).toBeCalledWith({ size: DEFAULT_SIZE });
7169

7270
expect(mockDataPresenter).toHaveBeenCalledWith(plainListContentTypeSchemas);
7371
expect(mockDataPresenter.mock.instances[0].render).toHaveBeenCalledWith({ itemMapFn, json: argv.json });

src/commands/content-type-schema/list.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { CommandOptions } from '../../interfaces/command-options.interface';
33
import DataPresenter, { RenderingArguments, RenderingOptions } from '../../view/data-presenter';
44
import dynamicContentClientFactory from '../../services/dynamic-content-client-factory';
55
import { ConfigurationParameters } from '../configure';
6-
import { extractSortable, SortingOptions, PagingParameters } from '../../common/yargs/sorting-options';
76
import { ContentTypeSchema } from 'dc-management-sdk-js';
87
import paginator from '../../common/dc-management-sdk-js/paginator';
98

@@ -12,7 +11,6 @@ export const command = 'list';
1211
export const desc = "List Content Type Schema's";
1312

1413
export const builder: CommandOptions = {
15-
...SortingOptions,
1614
...RenderingOptions
1715
};
1816

@@ -23,12 +21,10 @@ export const itemMapFn = ({ id, schemaId, version, validationLevel }: ContentTyp
2321
validationLevel
2422
});
2523

26-
export const handler = async (
27-
argv: Arguments<ConfigurationParameters & RenderingArguments & PagingParameters>
28-
): Promise<void> => {
24+
export const handler = async (argv: Arguments<ConfigurationParameters & RenderingArguments>): Promise<void> => {
2925
const client = dynamicContentClientFactory(argv);
3026
const hub = await client.hubs.get(argv.hubId);
31-
const contentTypeSchemaList = await paginator(hub.related.contentTypeSchema.list, extractSortable(argv));
27+
const contentTypeSchemaList = await paginator(hub.related.contentTypeSchema.list);
3228

3329
new DataPresenter(contentTypeSchemaList.map(value => value.toJson())).render({
3430
json: argv.json,

0 commit comments

Comments
 (0)