edit operatorOnly on toggle change

This commit is contained in:
Ruben Fiszel
2023-01-09 16:41:00 +01:00
parent 6e9c61a7fb
commit e2f2db2d7f
2 changed files with 13 additions and 12 deletions

View File

@@ -354,7 +354,10 @@ async fn edit_auto_invite(
.await?;
tx.commit().await?;
Ok(format!("Edit command script {}", &w_id))
Ok(format!(
"Edit auto-invite for workspace {} to {}",
&w_id, domain
))
}
async fn list_workspaces_as_super_admin(

View File

@@ -109,8 +109,6 @@
}
}
$: operatorOnly != undefined && auto_invite_domain && setOperatorOnly()
async function removeAllInvitesFromDomain() {
await Promise.all(
invites
@@ -127,15 +125,6 @@
)
)
}
async function setOperatorOnly() {
await removeAllInvitesFromDomain()
await WorkspaceService.editAutoInvite({
workspace: $workspaceStore ?? '',
requestBody: { operator: operatorOnly }
})
loadSettings()
listInvites()
}
</script>
<SearchItems
@@ -349,6 +338,15 @@
options={{
right: `Auto-invited users to join as operators`
}}
on:change={async (e) => {
await removeAllInvitesFromDomain()
await WorkspaceService.editAutoInvite({
workspace: $workspaceStore ?? '',
requestBody: { operator: e.detail }
})
loadSettings()
listInvites()
}}
/>
<div>
<Button