diff --git a/CHANGELOG.md b/CHANGELOG.md index a0bd4d57..a271702c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,14 @@ * change in the management of measurement models +# [2.5.0-dev.2](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.5.0-dev.1...v2.5.0-dev.2) (2024-11-18) + + +### Bug Fixes + +* backport fix ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([5392b56](https://github.com/kuzzleio/kuzzle-device-manager/commit/5392b56a9478b1c1932845ee44965d5978197350)) +* getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) + # [2.5.0-beta.1](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.5.0-beta.1) (2024-11-12) @@ -26,6 +34,13 @@ * **measure:** allow measures to be pushed on Assets via API (no devices) ([#344](https://github.com/kuzzleio/kuzzle-device-manager/issues/344)) ([c1073c1](https://github.com/kuzzleio/kuzzle-device-manager/commit/c1073c1f0ccb4cfc7cee64d86c51a4999617fd41)) +## [2.4.4](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.4.4) (2024-11-18) + + +### Bug Fixes + +* getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) + ## [2.4.3](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.2...v2.4.3) (2024-10-25) diff --git a/lib/modules/model/ModelService.ts b/lib/modules/model/ModelService.ts index a8e51309..65b407b6 100644 --- a/lib/modules/model/ModelService.ts +++ b/lib/modules/model/ModelService.ts @@ -616,7 +616,12 @@ export class ModelService extends BaseService { ): Promise> { const query = { and: [ - { equals: { engineGroup } }, + { + or: [ + { equals: { engineGroup } }, + { equals: { engineGroup: "commons" } }, + ], + }, { equals: { type: "asset" } }, { equals: { "asset.model": model } }, ], diff --git a/tests/scenario/modules/models/asset-model.test.ts b/tests/scenario/modules/models/asset-model.test.ts index 9702df23..ddaf9281 100644 --- a/tests/scenario/modules/models/asset-model.test.ts +++ b/tests/scenario/modules/models/asset-model.test.ts @@ -110,15 +110,6 @@ describe("ModelsController:assets", () => { _id: "model-asset-Plane", _source: { asset: { model: "Plane" } }, }); - - const getAssetNotExist = sdk.query({ - controller: "device-manager/models", - action: "getAsset", - engineGroup: "other_engine", - model: "Plane", - }); - - await expect(getAssetNotExist).rejects.toMatchObject({ status: 404 }); }); it("List asset models only from the requested engine group and the common ones", async () => {