From 19521af0453c96b182a17fcb4b80e1830c16d7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 23 Feb 2022 11:17:24 +0100 Subject: [PATCH] stop using EntityRef in code-coverage-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/code-coverage-backend/src/service/router.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/code-coverage-backend/src/service/router.ts b/plugins/code-coverage-backend/src/service/router.ts index 5f136cc8e9..4922f5c887 100644 --- a/plugins/code-coverage-backend/src/service/router.ts +++ b/plugins/code-coverage-backend/src/service/router.ts @@ -34,9 +34,8 @@ import { Cobertura } from './converter/cobertura'; import { Jacoco } from './converter/jacoco'; import { Converter } from './converter'; import { - EntityRef, getEntitySourceLocation, - parseEntityName, + parseEntityRef, } from '@backstage/catalog-model'; export interface RouterOptions { @@ -78,7 +77,7 @@ export const makeRouter = async ( */ router.get('/report', async (req, res) => { const { entity } = req.query; - const entityName = parseEntityName(entity as EntityRef); + const entityName = parseEntityRef(entity as string); const entityLookup = await catalogApi.getEntityByName(entityName); if (!entityLookup) { throw new NotFoundError(`No entity found matching ${entity}`); @@ -101,7 +100,7 @@ export const makeRouter = async ( */ router.get('/history', async (req, res) => { const { entity } = req.query; - const entityName = parseEntityName(entity as EntityRef); + const entityName = parseEntityRef(entity as string); const entityLookup = await catalogApi.getEntityByName(entityName); if (!entityLookup) { throw new NotFoundError(`No entity found matching ${entity}`); @@ -120,7 +119,7 @@ export const makeRouter = async ( */ router.get('/file-content', async (req, res) => { const { entity, path } = req.query; - const entityName = parseEntityName(entity as EntityRef); + const entityName = parseEntityRef(entity as string); const entityLookup = await catalogApi.getEntityByName(entityName); if (!entityLookup) { throw new NotFoundError(`No entity found matching ${entity}`); @@ -172,7 +171,7 @@ export const makeRouter = async ( */ router.post('/report', async (req, res) => { const { entity, coverageType } = req.query; - const entityName = parseEntityName(entity as EntityRef); + const entityName = parseEntityRef(entity as string); const entityLookup = await catalogApi.getEntityByName(entityName); if (!entityLookup) { throw new NotFoundError(`No entity found matching ${entity}`);