From 0104a7a1ff9b1ae1a1aa26019a6bd2ae61bedf20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?=
Date: Mon, 17 May 2021 13:01:16 +0200
Subject: [PATCH] adds updateRoles method to users store
---
.../portal/manage/users/[userId].svelte | 15 ++++-------
.../users/_components/UpdateRolesModal.svelte | 25 +++++++++++--------
packages/builder/src/stores/portal/users.js | 14 ++++++-----
3 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
index 9f8c0239f4..8af9467b76 100644
--- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
+++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte
@@ -25,21 +25,17 @@
const roleSchema = {
name: { displayName: "App" },
- roles: { type: "options" },
+ role: { type: "options" },
}
// Here we need to merge the Apps list and the roles response to get something that makes sense for the table
- $: appList = $apps.map(app => ({ ...app, roles: ["READ"] }))
+ $: appList = $apps.map(app => ({
+ ...app,
+ role: $request?.data?.roles?.[app._id],
+ }))
let selectedApp
const request = fetchData(`/api/admin/users/${userId}`)
- const roles = fetchData(
- `/api/admin/roles/app_5a72d9b923504765852338e614a72c85`
- )
-
- $: console.log($apps)
-
- $: console.log($roles)
async function deleteUser() {
const res = await users.del(userId)
@@ -71,7 +67,6 @@
ut nesciunt ipsam perspiciatis aliquam et hic minus alias beatae. Odit
veritatis quos quas laborum magnam tenetur perspiciatis ex hic.
Update {user.email}'s roles for {app.name}.