adds dummy updateRoles functioon to users store

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-14 15:04:15 +02:00
parent 132dd2cbe0
commit 3873ed32b5
1 changed files with 10 additions and 1 deletions

View File

@ -21,7 +21,7 @@ export function createUsersStore() {
} }
async function create({ email, password }) { 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() init()
return await response.json() return await response.json()
} }
@ -32,12 +32,21 @@ export function createUsersStore() {
return await response.json() 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 { return {
subscribe, subscribe,
init, init,
invite, invite,
acceptInvite, acceptInvite,
create, create,
updateRoles,
del del
} }
} }