Skip to content

Commit

Permalink
fix(vercel): compat valine old data without status property
Browse files Browse the repository at this point in the history
fix #67
  • Loading branch information
lizheming committed Dec 15, 2020
1 parent 765240a commit 53ebc5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/server/src/controller/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ module.exports = class extends BaseRest {
}
if(status) {
where.status = status;

//compat with valine old data without status property
if(status === 'approved') {
where.status = ['NOT IN', 'spam'];
}
}

if(keyword) {
where.comment = ['LIKE', `%${keyword}%`];
}
Expand Down

0 comments on commit 53ebc5a

Please sign in to comment.