Merge pull request #4621 from nhidtran/enhancement/4423

Enhancement/4423: remove the usage of res.send() for res.json()
This commit is contained in:
Patrik Oldsberg
2021-03-01 17:54:09 +01:00
committed by GitHub
11 changed files with 46 additions and 28 deletions
@@ -63,7 +63,7 @@ export async function createRouter({
entityName,
);
res.send(techdocsMetadata);
res.json(techdocsMetadata);
} catch (err) {
logger.error(
`Unable to get metadata for ${entityName.namespace}/${entityName.name} with error ${err}`,
@@ -93,7 +93,7 @@ export async function createRouter({
).json()) as Entity;
const locationMetadata = getLocationForEntity(entity);
res.send({ ...entity, locationMetadata });
res.json({ ...entity, locationMetadata });
} catch (err) {
logger.info(
`Unable to get metadata for ${kind}/${namespace}/${name} with error ${err}`,