@movalib/movalib-commons 1.9.0 → 1.11.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.
@@ -2,6 +2,7 @@ import { APIResponse } from "../helpers/ApiHelper";
2
2
  import Employee from "../models/Employee";
3
3
  import Garage from "../models/Garage";
4
4
  export default class GarageService {
5
+ static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>>;
5
6
  static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>>;
6
7
  static enableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
7
8
  static disableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
@@ -23,6 +24,6 @@ export default class GarageService {
23
24
  static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
24
25
  static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>>;
25
26
  static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>>;
26
- static updateGarage(garageId: string, formData: FormData): Promise<APIResponse<string>>;
27
+ static updateGarage(garageId: string, req: any): Promise<APIResponse<string>>;
27
28
  static getAdministratedGarages(): Promise<APIResponse<Garage[]>>;
28
29
  }
@@ -5,6 +5,14 @@ var Enums_1 = require("../helpers/Enums");
5
5
  var GarageService = /** @class */ (function () {
6
6
  function GarageService() {
7
7
  }
8
+ GarageService.uploadLogo = function (garageId, formData) {
9
+ return (0, ApiHelper_1.request)({
10
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/logo"),
11
+ method: Enums_1.APIMethod.PATCH,
12
+ appType: Enums_1.MovaAppType.GARAGE,
13
+ body: formData
14
+ });
15
+ };
8
16
  GarageService.sendAppointmentVehicleAvailable = function (garageId, eventId) {
9
17
  return (0, ApiHelper_1.request)({
10
18
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicle-available"),
@@ -166,12 +174,12 @@ var GarageService = /** @class */ (function () {
166
174
  body: JSON.stringify(req)
167
175
  });
168
176
  };
169
- GarageService.updateGarage = function (garageId, formData) {
177
+ GarageService.updateGarage = function (garageId, req) {
170
178
  return (0, ApiHelper_1.request)({
171
179
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId),
172
180
  method: Enums_1.APIMethod.PATCH,
173
181
  appType: Enums_1.MovaAppType.GARAGE,
174
- body: formData
182
+ body: JSON.stringify(req)
175
183
  });
176
184
  };
177
185
  GarageService.getAdministratedGarages = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.9.0",
3
+ "version": "1.11.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",
@@ -5,6 +5,15 @@ import Garage from "../models/Garage";
5
5
 
6
6
  export default class GarageService {
7
7
 
8
+ static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>> {
9
+ return request({
10
+ url: `${API_BASE_URL}/garage/${garageId}/logo`,
11
+ method: APIMethod.PATCH,
12
+ appType: MovaAppType.GARAGE,
13
+ body: formData
14
+ });
15
+ }
16
+
8
17
  static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>> {
9
18
  return request({
10
19
  url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle-available`,
@@ -191,12 +200,12 @@ export default class GarageService {
191
200
  });
192
201
  }
193
202
 
194
- static updateGarage(garageId: string, formData: FormData): Promise<APIResponse<string>> {
203
+ static updateGarage(garageId: string, req: any): Promise<APIResponse<string>> {
195
204
  return request({
196
205
  url: `${API_BASE_URL}/garage/${garageId}`,
197
206
  method: APIMethod.PATCH,
198
207
  appType: MovaAppType.GARAGE,
199
- body: formData
208
+ body: JSON.stringify(req)
200
209
  });
201
210
  }
202
211