btrz-api-client 8.45.0 → 8.45.1
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.
|
@@ -185,12 +185,30 @@ function controlClassesFactory(_ref) {
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
var schedules = {
|
|
189
|
+
post: function post(_ref7) {
|
|
190
|
+
var token = _ref7.token,
|
|
191
|
+
jwtToken = _ref7.jwtToken,
|
|
192
|
+
controlClassId = _ref7.controlClassId,
|
|
193
|
+
data = _ref7.data,
|
|
194
|
+
headers = _ref7.headers;
|
|
195
|
+
|
|
196
|
+
return client({
|
|
197
|
+
url: "/control-classes/" + controlClassId + "/schedules",
|
|
198
|
+
method: "post",
|
|
199
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
200
|
+
data: data
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
188
205
|
return {
|
|
189
206
|
all: all,
|
|
190
207
|
get: get,
|
|
191
208
|
create: create,
|
|
192
209
|
update: update,
|
|
193
|
-
remove: remove
|
|
210
|
+
remove: remove,
|
|
211
|
+
schedules: schedules
|
|
194
212
|
};
|
|
195
213
|
}
|
|
196
214
|
|
package/package.json
CHANGED
|
@@ -155,12 +155,24 @@ function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
const schedules = {
|
|
159
|
+
post: ({token, jwtToken, controlClassId, data, headers}) => {
|
|
160
|
+
return client({
|
|
161
|
+
url: `/control-classes/${controlClassId}/schedules`,
|
|
162
|
+
method: "post",
|
|
163
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
164
|
+
data
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
158
169
|
return {
|
|
159
170
|
all,
|
|
160
171
|
get,
|
|
161
172
|
create,
|
|
162
173
|
update,
|
|
163
|
-
remove
|
|
174
|
+
remove,
|
|
175
|
+
schedules
|
|
164
176
|
};
|
|
165
177
|
}
|
|
166
178
|
|
|
@@ -63,4 +63,15 @@ describe("inventory/control-classes", () => {
|
|
|
63
63
|
controlClassId
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
+
|
|
67
|
+
it("should assign schedules to a control class", () => {
|
|
68
|
+
const controlClassId = "1234";
|
|
69
|
+
axiosMock.onPost(`/control-classes/${controlClassId}/schedules`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
70
|
+
return api.inventory.controlClasses.schedules.post({
|
|
71
|
+
token,
|
|
72
|
+
jwtToken,
|
|
73
|
+
controlClassId,
|
|
74
|
+
data: {scheduleIds: ["schedule1", "schedule2"]}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
66
77
|
});
|