Skip to content

Commit

Permalink
chore(sys): fix function name
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Oct 13, 2021
1 parent a85347f commit ecc0466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/system-server/src/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ObjectId } from "mongodb"
/**
* Get an account by account_id
*/
export async function getAccountByAppid(uid: string) {
export async function getAccountById(uid: string) {
assert.ok(uid, 'empty uid got')

const db = DatabaseAgent.db
Expand Down Expand Up @@ -37,7 +37,7 @@ export async function getAccountByUsername(username: string) {
*/
export async function isValidAccountId(uid: string) {
if (!uid) return false
const account = await getAccountByAppid(uid)
const account = await getAccountById(uid)
return account ? true : false
}

Expand Down
4 changes: 2 additions & 2 deletions packages/system-server/src/router/application/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as assert from 'assert'
import { Request, Response } from 'express'
import { getAccountByAppid } from '../../api/account'
import { getAccountById } from '../../api/account'
import { ApplicationStruct, createApplicationDb, generateAppid, getMyApplications } from '../../api/application'
import { Constants } from '../../constants'
import { ErrorCodes } from '../../constants/error-code'
Expand All @@ -26,7 +26,7 @@ export async function handleCreateApplication(req: Request, res: Response) {
const db = DatabaseAgent.db

// check the application quota in account
const account = await getAccountByAppid(uid)
const account = await getAccountById(uid)
assert.ok(account, 'empty account got')
const app_quota = account.quota?.app_count ?? 0
const my_apps = await getMyApplications(uid)
Expand Down

0 comments on commit ecc0466

Please sign in to comment.