Skip to content

Commit

Permalink
fix: backport fix (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebtiz13 committed Nov 18, 2024
2 parents 6d46cde + 8818ba3 commit 5392b56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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)


Expand Down
7 changes: 6 additions & 1 deletion lib/modules/model/ModelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,12 @@ export class ModelService extends BaseService {
): Promise<KDocument<AssetModelContent>> {
const query = {
and: [
{ equals: { engineGroup } },
{
or: [
{ equals: { engineGroup } },
{ equals: { engineGroup: "commons" } },
],
},
{ equals: { type: "asset" } },
{ equals: { "asset.model": model } },
],
Expand Down
9 changes: 0 additions & 9 deletions tests/scenario/modules/models/asset-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 5392b56

Please sign in to comment.