Skip to content

Commit

Permalink
fix: admin user init (#476)
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Du <i@bobdu.cc>
  • Loading branch information
BobDu authored Mar 13, 2024
1 parent 3195778 commit e63f8d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/src/storage/mongo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function updateChat(chatId: string, response: string, messageId: st
}

if (previousResponse)
// @ts-expect-error previousResponse
// @ts-expect-error https://jira.mongodb.org/browse/NODE-5214
update.$set.previousResponse = previousResponse

await chatCol.updateOne(query, update)
Expand Down Expand Up @@ -253,7 +253,7 @@ export async function createUser(email: string, password: string, roles?: UserRo
const userInfo = new UserInfo(email, password)
if (roles && roles.includes(UserRole.Admin))
userInfo.status = Status.Normal
if (status !== null)
if (status)
userInfo.status = status

userInfo.roles = roles
Expand Down

0 comments on commit e63f8d2

Please sign in to comment.