I noticed that the command teams app publish only logs the ID of the published app on success.
|
const res: { id: string; } = await request.post<{ id: string; }>(requestOptions); |
|
|
|
if (res && res.id) { |
|
logger.log(res.id); |
|
} |
I'm questioning why this is done. The original response of the API looks like:
{
"id": "e3e29acb-8c79-412b-b746-e6c39ff4cd22",
"externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311",
"name": "Test App",
"version": "1.0.0",
"distributionMethod": "organization"
}
- Shouldn't we log the entire response instead of only the ID?
- We should also add a
responseType: 'json' to the request options. Right now the response is not formatted as json but as a JSON string. Therefore the command cannot find res.id and won't log anything at all.
- Update the command output in the docs
I noticed that the command
teams app publishonly logs the ID of the published app on success.cli-microsoft365/src/m365/teams/commands/app/app-publish.ts
Lines 75 to 79 in da9cd2c
I'm questioning why this is done. The original response of the API looks like:
{ "id": "e3e29acb-8c79-412b-b746-e6c39ff4cd22", "externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311", "name": "Test App", "version": "1.0.0", "distributionMethod": "organization" }responseType: 'json'to the request options. Right now the response is not formatted as json but as a JSON string. Therefore the command cannot findres.idand won't log anything at all.