Skip to content

Commit d588a93

Browse files
fix: getAsset should search in commons assets too (#380)
1 parent be8cfc4 commit d588a93

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

lib/modules/model/ModelService.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,12 @@ export class ModelService extends BaseService {
572572
): Promise<KDocument<AssetModelContent>> {
573573
const query = {
574574
and: [
575-
{ equals: { engineGroup } },
575+
{
576+
or: [
577+
{ equals: { engineGroup } },
578+
{ equals: { engineGroup: "commons" } },
579+
],
580+
},
576581
{ equals: { type: "asset" } },
577582
{ equals: { "asset.model": model } },
578583
],

tests/scenario/modules/models/asset-model.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ describe("ModelsController:assets", () => {
111111
_id: "model-asset-Plane",
112112
_source: { asset: { model: "Plane" } },
113113
});
114-
115-
const getAssetNotExist = sdk.query({
116-
controller: "device-manager/models",
117-
action: "getAsset",
118-
engineGroup: "other_engine",
119-
model: "Plane",
120-
});
121-
122-
await expect(getAssetNotExist).rejects.toMatchObject({ status: 404 });
123114
});
124115

125116
it("List asset models only from the requested engine group and the common ones", async () => {

0 commit comments

Comments
 (0)