@movalib/movalib-commons 1.43.0 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@ import { MovaAppType } from "../helpers/Enums";
3
3
  import { EditVehicleParams } from "./VehicleService.types";
4
4
  export default class VehicleService {
5
5
  static getVehicleDescription(appType: MovaAppType, plate: string): Promise<APIResponse<string>>;
6
- static editVehicle({ vehicleId, ...payload }: EditVehicleParams): Promise<APIResponse<string>>;
6
+ static editVehicle({ vehicleId, appType, ...payload }: EditVehicleParams): Promise<APIResponse<string>>;
7
7
  }
@@ -24,10 +24,11 @@ var VehicleService = /** @class */ (function () {
24
24
  });
25
25
  };
26
26
  VehicleService.editVehicle = function (_a) {
27
- var vehicleId = _a.vehicleId, payload = __rest(_a, ["vehicleId"]);
27
+ var vehicleId = _a.vehicleId, appType = _a.appType, payload = __rest(_a, ["vehicleId", "appType"]);
28
28
  return (0, ApiHelper_1.request)({
29
29
  url: "".concat(ApiHelper_1.API_BASE_URL, "/vehicle/").concat(vehicleId),
30
30
  method: Enums_1.APIMethod.PATCH,
31
+ appType: appType !== null && appType !== void 0 ? appType : Enums_1.MovaAppType.GARAGE,
31
32
  body: JSON.stringify(payload)
32
33
  });
33
34
  };
@@ -1,3 +1,4 @@
1
+ import { MovaAppType } from "../helpers/Enums";
1
2
  export type EditVehicleParams = {
2
3
  /** Identifiant unique du véhicule */
3
4
  vehicleId: number;
@@ -10,4 +11,6 @@ export type EditVehicleParams = {
10
11
  tireHeight?: string;
11
12
  tireDiameter?: string;
12
13
  tireSpeedIndex?: string;
14
+ /** Si besoin, on peut préciser si la requête viens de Movalib PRO ou CLIENT */
15
+ appType?: MovaAppType;
13
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,10 +13,11 @@ export default class VehicleService {
13
13
  });
14
14
  }
15
15
 
16
- static editVehicle({vehicleId, ...payload}: EditVehicleParams): Promise<APIResponse<string>> {
16
+ static editVehicle({vehicleId, appType,...payload}: EditVehicleParams): Promise<APIResponse<string>> {
17
17
  return request({
18
18
  url: `${API_BASE_URL}/vehicle/${vehicleId}`,
19
19
  method: APIMethod.PATCH,
20
+ appType: appType ?? MovaAppType.GARAGE,
20
21
  body: JSON.stringify(payload)
21
22
  });
22
23
  }
@@ -1,3 +1,5 @@
1
+ import {MovaAppType} from "../helpers/Enums";
2
+
1
3
  export type EditVehicleParams = {
2
4
  /** Identifiant unique du véhicule */
3
5
  vehicleId: number;
@@ -13,4 +15,6 @@ export type EditVehicleParams = {
13
15
  tireDiameter?: string;
14
16
  tireSpeedIndex?: string;
15
17
 
18
+ /** Si besoin, on peut préciser si la requête viens de Movalib PRO ou CLIENT */
19
+ appType?: MovaAppType;
16
20
  }