Skip to content

Commit

Permalink
types: remove useless _id property for upsert requests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebtiz13 committed Dec 4, 2024
1 parent 48d034c commit 1d6d203
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions doc/2/controllers/assets/upsert/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The Upsert operation allows you to create a new asset or update an existing one
### HTTP

```http
URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:_id
Method: POST
URL: http://kuzzle:7512/_/device-manager/:engineId/assets
Method: PUT
```

## Other protocols
Expand Down
4 changes: 2 additions & 2 deletions doc/2/controllers/devices/upsert/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The Upsert operation allows you to create a new device or update an existing one
### HTTP

```http
URL: http://kuzzle:7512/_/device-manager/:engineId/devices/:_id
Method: POST
URL: http://kuzzle:7512/_/device-manager/:engineId/devices
Method: PUT
```

## Other protocols
Expand Down
4 changes: 1 addition & 3 deletions lib/modules/asset/AssetsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export class AssetsController {
},
upsert: {
handler: this.upsert.bind(this),
http: [
{ path: "device-manager/:engineId/assets/:_id", verb: "post" },
],
http: [{ path: "device-manager/:engineId/assets", verb: "put" }],
},
delete: {
handler: this.delete.bind(this),
Expand Down
3 changes: 0 additions & 3 deletions lib/modules/asset/types/AssetApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ export type ApiAssetMetadataReplaceResult = KDocument<AssetContent>;
export interface ApiAssetUpsertRequest extends AssetsControllerRequest {
action: "upsert";

// TODO it's unused in action, maybe should remove it
_id?: string;

refresh?: string;

body: {
Expand Down
4 changes: 1 addition & 3 deletions lib/modules/device/DevicesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export class DevicesController {
},
upsert: {
handler: this.upsert.bind(this),
http: [
{ path: "device-manager/:engineId/devices/:_id", verb: "post" },
],
http: [{ path: "device-manager/:engineId/devices", verb: "put" }],
},
replaceMetadata: {
handler: this.replaceMetadata.bind(this),
Expand Down
2 changes: 0 additions & 2 deletions lib/modules/device/types/DeviceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export type ApiDeviceMetadataReplaceResult = KDocument<DeviceContent>;
export interface ApiDeviceUpsertRequest extends DevicesControllerRequest {
action: "upsert";

_id: string;

refresh?: string;

body: {
Expand Down

0 comments on commit 1d6d203

Please sign in to comment.