Extends 'spe container get' command. Closes #6719#7052
Extends 'spe container get' command. Closes #6719#7052
Conversation
| try { | ||
| const res = await request.get<SpeContainer>(requestOptions); | ||
| await logger.log(res); | ||
| const response = await request.get<{ value?: SpeContainer[] }>(requestOptions); |
There was a problem hiding this comment.
Did you try to use $filter and return only containers with the specific name?
If filtering by the displayName not supported...rather use the odata.getAllItems which handles also paging and returns all items.
| const response = await request.get<{ value?: SpeContainer[] }>(requestOptions); | |
| const response = await odata.getAllItems<SpeContainer[]>(requestOptions); |
According to the doc the /v1.0/storage/fileStorage/containers endpoint requires the containerTypeId parameter. Does the query work without the containerTypeId?
In fact, if a user wants to retrieve a container by it's name, we will make two calls. One call to get all containers and find the one with the specific name. The second call to get a container by it's id even if we have already retrieved the container and its details in the first call.
| throw 'Invalid Request'; | ||
| }); | ||
|
|
||
| await command.action(logger, { options: { id: containerId } } as any); |
There was a problem hiding this comment.
Parse the command option from zod schema to ensure the inputs are correct.
| await command.action(logger, { options: { id: containerId } } as any); | |
| await command.action(logger, { options: schema.parse({ id: containerId }) } as any); |
Please do it for all unit tests.
Closes #6719