From 57278b4532caef8cd0a517084ad175c29953005d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Jul 2021 09:29:16 +0100 Subject: [PATCH] Allowing user firstname and lastname to be updated through user portal. --- .../builder/portal/manage/users/[userId].svelte | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 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 ac5b569411..495e45e7c3 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -60,6 +60,16 @@ let toggleDisabled = false + async function updateUserFirstName(evt) { + await users.save({ ...$userFetch?.data, firstName: evt.target.value }) + await userFetch.refresh() + } + + async function updateUserLastName(evt) { + await users.save({ ...$userFetch?.data, lastName: evt.target.value }) + await userFetch.refresh() + } + async function toggleFlag(flagName, detail) { toggleDisabled = true await users.save({ ...$userFetch?.data, [flagName]: { global: detail } }) @@ -113,11 +123,11 @@
- +
- +
{#if userId !== $auth.user._id}