diff --git a/packages/nodes-base/nodes/Zulip/StreamDescription.ts b/packages/nodes-base/nodes/Zulip/StreamDescription.ts index 777ae7ba61..9244ff52ad 100644 --- a/packages/nodes-base/nodes/Zulip/StreamDescription.ts +++ b/packages/nodes-base/nodes/Zulip/StreamDescription.ts @@ -48,6 +48,51 @@ export const streamFields = [ /* -------------------------------------------------------------------------- */ /* stream:create */ /* -------------------------------------------------------------------------- */ + { + displayName: 'Subscriptions', + name: 'subscriptions', + type: 'fixedCollection', + required: true, + default: '', + description: 'A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.', + displayOptions: { + show: { + resource: [ + 'stream', + ], + operation: [ + 'create', + ], + }, + }, + typeOptions: { + multipleValues: true, + }, + options: [ + { + displayName: 'Subscription Properties', + name: 'properties', + values: [ + { + displayName: 'Name', + name: 'name', + type: 'string', + required: true, + default: '', + description: 'Name of Subscription.', + }, + { + displayName: 'Description', + name: 'description', + type: 'string', + required: true, + default: '', + description: 'Description of Subscription.', + } + ], + }, + ], + }, { displayName: 'JSON Parameters', name: 'jsonParameters', @@ -162,40 +207,6 @@ export const streamFields = [ }, ], }, - { - displayName: 'Subscriptions', - name: 'subscriptions', - type: 'fixedCollection', - required: true, - description: '"A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.', - typeOptions: { - multipleValues: true, - }, - options: [ - { - displayName: 'Subscription Properties', - name: 'properties', - values: [ - { - displayName: 'Name', - name: 'name', - type: 'string', - required: true, - default: '', - description: 'Name of Subscription.', - }, - { - displayName: 'Description', - name: 'description', - type: 'string', - required: true, - default: '', - description: 'Description of Subscription.', - } - ], - }, - ], - }, { displayName: 'Stream Post Policy', name: 'streamPostPolicy', diff --git a/packages/nodes-base/nodes/Zulip/Zulip.node.ts b/packages/nodes-base/nodes/Zulip/Zulip.node.ts index d86d9c7ec6..1d336bf0d9 100644 --- a/packages/nodes-base/nodes/Zulip/Zulip.node.ts +++ b/packages/nodes-base/nodes/Zulip/Zulip.node.ts @@ -262,7 +262,11 @@ export class Zulip implements INodeType { if (operation === 'create') { const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean; + const subscriptions = this.getNodeParameter('subscriptions', i) as IDataObject[]; + //@ts-ignore + body.subscriptions = JSON.stringify(subscriptions.properties); + if (jsonParameters) { const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string; @@ -281,10 +285,6 @@ export class Zulip implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - if (additionalFields.subscriptions) { - //@ts-ignore - body.subscriptions = JSON.stringify(additionalFields.subscriptions.properties); - } if (additionalFields.inviteOnly) { body.invite_only = additionalFields.inviteOnly as boolean; }