@movalib/movalib-commons 1.51.0 → 1.51.2

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.
@@ -18,8 +18,9 @@ export default class GarageService {
18
18
  static createGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>>;
19
19
  static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, absenceId: string): Promise<APIResponse<string>>;
20
20
  static createGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
21
+ static updateGarageEmployee(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
21
22
  static updateGarageEmployeeSchedules(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
22
- static deleteGarageEmployee(garageId: string, req: any): Promise<APIResponse<string>>;
23
+ static deleteGarageEmployee(garageId: string, employeeId: string): Promise<APIResponse<string>>;
23
24
  static createGarageEmployee(garageId: string, req: any): Promise<APIResponse<string>>;
24
25
  static getEmployees(garageId: string): Promise<APIResponse<Employee[]>>;
25
26
  static activateGarage(garageId: string): Promise<APIResponse<string>>;
@@ -126,6 +126,14 @@ var GarageService = /** @class */ (function () {
126
126
  body: JSON.stringify(req)
127
127
  });
128
128
  };
129
+ GarageService.updateGarageEmployee = function (garageId, employeeId, req) {
130
+ return (0, ApiHelper_1.request)({
131
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId),
132
+ method: Enums_1.APIMethod.PATCH,
133
+ appType: Enums_1.MovaAppType.GARAGE,
134
+ body: JSON.stringify(req)
135
+ });
136
+ };
129
137
  GarageService.updateGarageEmployeeSchedules = function (garageId, employeeId, req) {
130
138
  return (0, ApiHelper_1.request)({
131
139
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/schedules"),
@@ -134,12 +142,11 @@ var GarageService = /** @class */ (function () {
134
142
  body: JSON.stringify(req)
135
143
  });
136
144
  };
137
- GarageService.deleteGarageEmployee = function (garageId, req) {
145
+ GarageService.deleteGarageEmployee = function (garageId, employeeId) {
138
146
  return (0, ApiHelper_1.request)({
139
- url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees"),
147
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId),
140
148
  method: Enums_1.APIMethod.DELETE,
141
- appType: Enums_1.MovaAppType.GARAGE,
142
- body: JSON.stringify(req)
149
+ appType: Enums_1.MovaAppType.GARAGE
143
150
  });
144
151
  };
145
152
  GarageService.createGarageEmployee = function (garageId, req) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.51.0",
3
+ "version": "1.51.2",
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",
@@ -134,6 +134,15 @@ export default class GarageService {
134
134
  });
135
135
  }
136
136
 
137
+ static updateGarageEmployee(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
138
+ return request({
139
+ url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
140
+ method: APIMethod.PATCH,
141
+ appType: MovaAppType.GARAGE,
142
+ body: JSON.stringify(req)
143
+ });
144
+ }
145
+
137
146
  static updateGarageEmployeeSchedules(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
138
147
  return request({
139
148
  url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/schedules`,
@@ -143,12 +152,11 @@ export default class GarageService {
143
152
  });
144
153
  }
145
154
 
146
- static deleteGarageEmployee(garageId: string, req: any): Promise<APIResponse<string>> {
155
+ static deleteGarageEmployee(garageId: string, employeeId: string): Promise<APIResponse<string>> {
147
156
  return request({
148
- url: `${API_BASE_URL}/garage/${garageId}/employees`,
157
+ url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
149
158
  method: APIMethod.DELETE,
150
- appType: MovaAppType.GARAGE,
151
- body: JSON.stringify(req)
159
+ appType: MovaAppType.GARAGE
152
160
  });
153
161
  }
154
162