fix: Add ability to choose user permission level when inviting (#2473)
* Select user role while sending invite * Add tests to check for role * Update app/scenes/Invite.js Co-authored-by: Tom Moor <tom.moor@gmail.com> * Use select * Use inviteUser policy * Remove unnecessary code * Normalize rank/role Fix text sizing of select input, fix alignment on users invite form * Move component to root * cleanup Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@ -298,7 +298,7 @@ User.getCounts = async function (teamId: string) {
|
||||
|
||||
User.prototype.demote = async function (
|
||||
teamId: string,
|
||||
to: "Member" | "Viewer"
|
||||
to: "member" | "viewer"
|
||||
) {
|
||||
const res = await User.findAndCountAll({
|
||||
where: {
|
||||
@ -312,9 +312,9 @@ User.prototype.demote = async function (
|
||||
});
|
||||
|
||||
if (res.count >= 1) {
|
||||
if (to === "Member") {
|
||||
if (to === "member") {
|
||||
return this.update({ isAdmin: false, isViewer: false });
|
||||
} else if (to === "Viewer") {
|
||||
} else if (to === "viewer") {
|
||||
return this.update({ isAdmin: false, isViewer: true });
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user