@webitel/api-services 26.8.88 → 26.8.89
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.
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
9
9
|
import {
|
|
10
10
|
applyTransform,
|
|
11
|
+
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitizeToWire,
|
|
@@ -302,15 +303,17 @@ const sanitizeListFields = (itemInstance: ApiParams) => {
|
|
|
302
303
|
const add = async ({ itemInstance }: AddItemParams) => {
|
|
303
304
|
// `name`/`managers[].user`/`timezones[].timezone`/`groups[].group` are
|
|
304
305
|
// expected already in the shape `ContactsInputContact` declares (e.g.
|
|
305
|
-
// `name: { commonName }`, not a plain string)
|
|
306
|
-
//
|
|
307
|
-
// here anymore.
|
|
306
|
+
// `name: { commonName }`, not a plain string). Nested keys are rewritten
|
|
307
|
+
// to the wire spelling below (`commonName` -> `common_name`).
|
|
308
308
|
const item = applyTransform(itemInstance, [
|
|
309
309
|
sanitizeManagers,
|
|
310
310
|
sanitizeTimezones,
|
|
311
311
|
sanitizeGroups,
|
|
312
312
|
sanitizeListFields,
|
|
313
313
|
sanitizeToWire(createFieldsToSend),
|
|
314
|
+
camelToSnake([
|
|
315
|
+
'custom',
|
|
316
|
+
]),
|
|
314
317
|
]);
|
|
315
318
|
try {
|
|
316
319
|
const response = await getContacts().createContact(item);
|
|
@@ -334,6 +337,9 @@ const update = async ({ itemInstance }: AddItemParams) => {
|
|
|
334
337
|
sanitizeGroups,
|
|
335
338
|
sanitizeListFields,
|
|
336
339
|
sanitizeToWire(updateFieldsToSend),
|
|
340
|
+
camelToSnake([
|
|
341
|
+
'custom',
|
|
342
|
+
]),
|
|
337
343
|
]);
|
|
338
344
|
try {
|
|
339
345
|
const response = await getContacts().updateContact(etag, item, {
|