Skip to content

Commit

Permalink
docs: jsdoc account service
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Aug 5, 2024
1 parent e2b4644 commit 0611074
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/web/server/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ interface AccountDeleteData {
password: string
}

/**
* Change self account password
*
* @param data
* @returns void
*/
export async function accountChangePassword(data: AccountChangePasswordData): Promise<void> {
const db = useDatabase()
const changePasswordSchema = z.object({
Expand Down Expand Up @@ -49,6 +55,12 @@ export async function accountChangePassword(data: AccountChangePasswordData): Pr
.where(eq(tables.users.id, userId))
}

/**
* Change self account general information
*
* @param data
* @returns void
*/
export async function changeGeneralInfo(data: AccountGeneralData): Promise<void> {
const db = useDatabase()
const changeGeneralInfoSchema = z.object({
Expand All @@ -71,6 +83,12 @@ export async function changeGeneralInfo(data: AccountGeneralData): Promise<void>
.where(eq(tables.users.id, userId))
}

/**
* Delete self account
*
* @param data
* @returns void
*/
export async function accountDelete(data: AccountDeleteData): Promise<void> {
const db = useDatabase()
const deleteAccountSchema = z.object({
Expand Down

0 comments on commit 0611074

Please sign in to comment.