Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
feat(user): indicate the success upon resetting password
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 14, 2022
1 parent 842dacb commit 48e26a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pages/user/read.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ import {
import type { FieldStatus } from "@/fields/types"
import type { PageContext } from "$/types/renderer"
import type { OptionInfo } from "$@/types/component"
import type { ResourceCount } from "$/types/documents/base"
import type { DeserializedUserDocument } from "$/types/documents/user"
import type { DeserializedRoleListDocument } from "$/types/documents/role"
import type { DeserializedDepartmentListDocument } from "$/types/documents/department"
Expand Down Expand Up @@ -359,8 +358,14 @@ const hasPerformedWholeChange = ref<boolean>(true)
async function resetUserPassword() {
hasPerformedWholeChange.value = false
await fetcher.resetPassword(user.value.data.id)
.then(({ body, status }) => {
console.log(body, status)
.then(() => {
const command = "Please check the inbox of the registered email for the password."
const note = "Email may not be sent if the email is not verified."
successMessages.value = [
...successMessages.value,
`${command} ${note}`
]
})
.catch(response => extractAllErrorDetails(response, receivedErrors, successMessages))
hasPerformedWholeChange.value = true
Expand Down

0 comments on commit 48e26a3

Please sign in to comment.