From ecf324453e7226662405cb28959801c5e38b7cf0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 25 Mar 2020 11:28:45 +0000 Subject: [PATCH] bug fix for indexes --- packages/builder/src/database/IndexView.svelte | 2 +- packages/builder/src/database/ModelDataTable/api.js | 4 ++-- .../src/database/ModelDataTable/modals/CreateUser.svelte | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/database/IndexView.svelte b/packages/builder/src/database/IndexView.svelte index 22a868ea15..bcc9a52aed 100644 --- a/packages/builder/src/database/IndexView.svelte +++ b/packages/builder/src/database/IndexView.svelte @@ -23,7 +23,7 @@ isallowed: index.allowedRecordNodeIds.some(id => node.nodeId === id), })), filter(hierarchyFunctions.isRecord), - filter(hierarchyFunctions.isDecendant(index.parent())), + filter(hierarchyFunctions.isDecendant($store.currentNode.parent())), hierarchyFunctions.getFlattenedHierarchy ) diff --git a/packages/builder/src/database/ModelDataTable/api.js b/packages/builder/src/database/ModelDataTable/api.js index dd4243fe6f..8d71fdf8a5 100644 --- a/packages/builder/src/database/ModelDataTable/api.js +++ b/packages/builder/src/database/ModelDataTable/api.js @@ -1,9 +1,9 @@ import api from "../../builderStore/api" import { getNewRecord, getNewInstance } from "../../common/core" -export async function createUser(user, { appname, instanceId }) { +export async function createUser(password, user, { appname, instanceId }) { const CREATE_USER_URL = `/_builder/instance/${appname}/${instanceId}/api/createUser` - const response = await api.post(CREATE_USER_URL, user) + const response = await api.post(CREATE_USER_URL, { user, password }) return await response.json() } diff --git a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte index ef79221900..cc7e00d1d9 100644 --- a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte +++ b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte @@ -18,11 +18,12 @@ async function createUser() { const response = await api.createUser( + password, { username, - password, accessLevels, enabled: true, + temporaryAccessId: "" }, currentAppInfo )