Browse Source

Fix bug where non-existent variable was being accessed leading to an error being thrown; fix by accessing this.username property

sbkwgh 7 năm trước cách đây
mục cha
commit
e95af412bc
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      models/user.js

+ 1 - 1
models/user.js

@@ -109,7 +109,7 @@ module.exports = (sequelize, DataTypes) => {
 					meta.nextPostsCount = 0
 				} else {
 					meta.nextURL =
-						`/api/v1/user/${user.username}?posts=true&limit=${limit}&from=${nextId - 1}`
+						`/api/v1/user/${this.username}?posts=true&limit=${limit}&from=${nextId - 1}`
 
 					meta.nextPostsCount = await pagination.getNextCount(
 						Post, this.Posts, limit,