Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
feat: compatible new version of mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
YanceyOfficial committed Dec 29, 2020
1 parent c60c9f3 commit f035239
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AuthService {
}

private generateJWT(email: string, res: User) {
const { password, totpSecret, recoveryCodes, ...rest } = res.toObject() as User
const { password, totpSecret, recoveryCodes, ...rest } = res
const payload = { email, sub: res._id, issuer: 'Yancey Inc.' }
return { authorization: this.jwtService.sign(payload), ...rest }
}
Expand Down
2 changes: 1 addition & 1 deletion src/posts/posts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class PostsService {
.limit(1)

const res = {
...curr.toObject(),
...curr,
prev: prev[0] ? prev[0] : null,
next: next[0] ? next[0] : null,
}
Expand Down
1 change: 1 addition & 0 deletions src/users/interfaces/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum Roles {

export interface User extends Document {
password: string
readonly _id: string
readonly username: string
readonly email: string
readonly role: Roles
Expand Down

0 comments on commit f035239

Please sign in to comment.