fix getLocationByEntity to use original_value
Signed-off-by: Jamie Tang <jamie.tang@autodesk.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Fixed getLocationByEntity to use `original_value` instead of `value` when querying search table
|
||||
@@ -137,15 +137,15 @@ export class DefaultLocationStore implements LocationStore, EntityProvider {
|
||||
entity_id: entityRow.entity_id,
|
||||
key: `metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`,
|
||||
})
|
||||
.select('value')
|
||||
.select('original_value')
|
||||
.limit(1);
|
||||
if (!searchRow?.value) {
|
||||
if (!searchRow?.original_value) {
|
||||
throw new NotFoundError(
|
||||
`found no origin annotation for ref ${entityRefString}`,
|
||||
);
|
||||
}
|
||||
|
||||
const { type, target } = parseLocationRef(searchRow.value);
|
||||
const { type, target } = parseLocationRef(searchRow.original_value);
|
||||
const [locationRow] = await this.db<DbLocationsRow>('locations')
|
||||
.where({ type, target })
|
||||
.select()
|
||||
|
||||
Reference in New Issue
Block a user