2021-05-19 21:25:23 +12:00
|
|
|
<script>
|
2021-05-20 01:05:08 +12:00
|
|
|
import { ModalContent, Body, Input, notifications } from "@budibase/bbui"
|
2021-05-19 21:25:23 +12:00
|
|
|
import { writable } from "svelte/store"
|
2021-05-20 01:05:08 +12:00
|
|
|
import { auth } from "stores/portal"
|
2021-05-19 21:25:23 +12:00
|
|
|
|
|
|
|
const values = writable({
|
|
|
|
firstName: $auth.user.firstName,
|
|
|
|
lastName: $auth.user.lastName,
|
|
|
|
})
|
|
|
|
|
|
|
|
const updateInfo = async () => {
|
2021-05-20 01:05:08 +12:00
|
|
|
try {
|
2021-05-22 02:23:39 +12:00
|
|
|
await auth.updateSelf($values)
|
2021-05-20 01:05:08 +12:00
|
|
|
notifications.success("Information updated successfully")
|
|
|
|
} catch (error) {
|
|
|
|
notifications.error("Failed to update information")
|
|
|
|
}
|
2021-05-19 21:25:23 +12:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<ModalContent
|
|
|
|
title="Update user information"
|
|
|
|
confirmText="Update information"
|
|
|
|
onConfirm={updateInfo}
|
|
|
|
>
|
|
|
|
<Body size="S">
|
|
|
|
Personalise the platform by adding your first name and last name.
|
|
|
|
</Body>
|
2021-10-22 05:32:01 +13:00
|
|
|
<Input disabled bind:value={$auth.user.email} label="Email" />
|
2021-05-19 21:25:23 +12:00
|
|
|
<Input bind:value={$values.firstName} label="First name" />
|
|
|
|
<Input bind:value={$values.lastName} label="Last name" />
|
|
|
|
</ModalContent>
|