Add role parameter to user:update (Zulip) (#2336)

*  Add role parameter to user:update

* ✏️ Fix typo issue
This commit is contained in:
Ricardo Espinoza 2021-11-10 18:03:45 -05:00 committed by GitHub
parent 3c6f38d045
commit 1a1bc26ecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 2 deletions

View file

@ -226,14 +226,14 @@ export const userFields = [
name: 'isAdmin', name: 'isAdmin',
type: 'boolean', type: 'boolean',
default: false, default: false,
description: 'Whether the target user is an administrator.', description: 'Whether the target user is an administrator',
}, },
{ {
displayName: 'Is Guest', displayName: 'Is Guest',
name: 'isGuest', name: 'isGuest',
type: 'boolean', type: 'boolean',
default: false, default: false,
description: 'Whether the target user is a guest.', description: 'Whether the target user is a guest',
}, },
{ {
displayName: 'Profile Data', displayName: 'Profile Data',
@ -268,6 +268,35 @@ export const userFields = [
}, },
], ],
}, },
{
displayName: 'Role',
name: 'role',
type: 'options',
options: [
{
name: 'Organization Owner',
value: 100,
},
{
name: 'Organization Administrator',
value: 200,
},
{
name: 'Organization Moderator',
value: 300,
},
{
name: 'Member',
value: 400,
},
{
name: 'Guest',
value: 600,
},
],
default: '',
description: 'Role for the user',
},
], ],
}, },

View file

@ -8,4 +8,5 @@ export interface IUser {
email?: string; email?: string;
password?: string; password?: string;
short_name?: string; short_name?: string;
role?: number;
} }

View file

@ -431,6 +431,9 @@ export class Zulip implements INodeType {
if (additionalFields.isGuest) { if (additionalFields.isGuest) {
body.is_guest = additionalFields.isGuest as boolean; body.is_guest = additionalFields.isGuest as boolean;
} }
if (additionalFields.role) {
body.role = additionalFields.role as number;
}
if (additionalFields.profileData) { if (additionalFields.profileData) {
//@ts-ignore //@ts-ignore
body.profile_data = additionalFields.profileData.properties as [{}]; body.profile_data = additionalFields.profileData.properties as [{}];