From ac883053e0cdacaccbd8be075c8ab6b61b3476ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 14 May 2021 15:04:15 +0200 Subject: [PATCH] adds dummy updateRoles functioon to users store --- packages/builder/src/stores/portal/users.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/stores/portal/users.js b/packages/builder/src/stores/portal/users.js index 606a888316..d3844b664c 100644 --- a/packages/builder/src/stores/portal/users.js +++ b/packages/builder/src/stores/portal/users.js @@ -21,7 +21,7 @@ export function createUsersStore() { } async function create({ email, password }) { - const response = await api.post("/api/admin/users", { email, password, roles: {} }) + const response = await api.post("/api/admin/users", { email, password, builder: { global: true}, roles: {} }) init() return await response.json() } @@ -32,12 +32,21 @@ export function createUsersStore() { return await response.json() } + async function updateRoles(data) { + console.log(data) + // const res = await api.post(`/api/admin/users`, data) + // console.log(await res.json()) + // update(users => (users.filter(user => user._id !== id))) + // return await response.json() + } + return { subscribe, init, invite, acceptInvite, create, + updateRoles, del } }