Skip to content

Commit

Permalink
无需报错
Browse files Browse the repository at this point in the history
  • Loading branch information
diyanqi committed Aug 1, 2023
1 parent 3cea3ff commit 93f3653
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/server/src/controller/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,7 @@ module.exports = class extends BaseRest {
data.like =
(Number(oldData.like) || 0) +
(data.like ? Math.ceil(Math.random() * likeIncMax) : -1);
if (data.like < 0) {
return this.fail(this.locale('Like less than zero'));
}
data.like = Math.max(data.like, 0);
}

const preUpdateResp = await this.hook('preUpdate', {
Expand Down

0 comments on commit 93f3653

Please sign in to comment.