diff --git a/packages/client/src/models/dataValue.ts b/packages/client/src/models/dataValue.ts index 41005b9..0aaa138 100644 --- a/packages/client/src/models/dataValue.ts +++ b/packages/client/src/models/dataValue.ts @@ -19,6 +19,11 @@ export interface CollectionWithType { $values: T[]; } +export interface MultilingualCollectionWithType { + $type: string; + values: T[]; +} + export interface MultiCurrencyWithType extends MultiCurrency { $type: string; } @@ -51,12 +56,12 @@ export class StringCollectionDataValue extends DataValueBase> { +export class MultilingualCollectionDataValue extends DataValueBase> { constructor(values: { values: string[], language: string }[]) { super('MultilingualCollection', { - $type: 'System.Collections.Generic.List`1[[Relewise.Client.DataTypes.Multilingual, Relewise.Client]], System.Private.CoreLib', - $values: values.map(x => ({ values: x.values, language: { value: x.language } })), + $type: 'Relewise.Client.DataTypes.MultilingualCollection, Relewise.Client', + values: values.map(x => ({ values: x.values, language: { value: x.language } })), }); } diff --git a/packages/integrations/tests/integration-tests/products/updates.integration.test.ts b/packages/integrations/tests/integration-tests/products/updates.integration.test.ts index c2e0644..b03e8ee 100644 --- a/packages/integrations/tests/integration-tests/products/updates.integration.test.ts +++ b/packages/integrations/tests/integration-tests/products/updates.integration.test.ts @@ -21,6 +21,7 @@ test('Create Product', async() => { 'Tags': DataValueFactory.stringCollection(['fall collection', 'blue', 'good-deal']), 'InStock': DataValueFactory.boolean(true), 'Removed': null, + 'Materials': DataValueFactory.multilingualCollection([{ values: ['Wood', 'Metal'], language: 'da' }]), 'Complex': DataValueFactory.object({ 'nestedDataKey': DataValueFactory.string('Key'), }),