Skip to content

Commit e8e4dc1

Browse files
authored
2.0.9 - Fix metadata arg in body for device update (#261)
The action device-manager/devices:update was supposed to take the updated metadata in the body.metadata object but it was not the case. Other changes Convert cucumber scenario of this feature into jest test
1 parent 28ed661 commit e8e4dc1

File tree

14 files changed

+5844
-2743
lines changed

14 files changed

+5844
-2743
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"overrides": [
99
{
10-
"files": ["**/roles/*.ts", "**/collections/*.ts"],
10+
"files": ["**/roles/*.ts", "**/collections/*.ts", "**tests/**/*.ts"],
1111
"rules": {
1212
"sort-keys": ["off"]
1313
}

features/Device/Controller/SCRUD.feature

Lines changed: 0 additions & 39 deletions
This file was deleted.

jest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { Config } from "@jest/types";
2+
3+
// Sync object
4+
const config: Config.InitialOptions = {
5+
verbose: true,
6+
transform: {
7+
"^.+\\.tsx?$": "ts-jest",
8+
},
9+
};
10+
export default config;

lib/modules/device/DevicesController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class DevicesController {
123123
async update(request: KuzzleRequest): Promise<ApiDeviceUpdateResult> {
124124
const deviceId = request.getId();
125125
const engineId = request.getString("engineId");
126-
const metadata = request.getBody();
126+
const metadata = request.getBodyObject("metadata");
127127
const refresh = request.getRefresh();
128128

129129
const updatedDevice = await this.deviceService.update(

lib/modules/device/types/DeviceApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export interface ApiDeviceSearchRequest extends DevicesControllerRequest {
6767

6868
scrollTTL?: string;
6969

70+
lang?: "koncorde" | "elasticsearch";
71+
7072
body: JSONObject;
7173
}
7274
export type ApiDeviceSearchResult = SearchResult<KHit<DeviceContent>>;

0 commit comments

Comments
 (0)