FIX 优化点赞、关注等功能

This commit is contained in:
Jasder
2020-03-27 17:31:31 +08:00
parent 4822730651
commit 7ffc99b9d2
2 changed files with 9 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ class WatchersController < ApplicationController
begin
return normal_status(2, "你还没有关注哦") unless current_user.watched?(@project)
current_user.unwatch!(@project)
render_ok
render_ok({watchers_count: @project.watchers_count, watched: current_user.watched?(@project)})
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
@@ -23,7 +23,7 @@ class WatchersController < ApplicationController
begin
return normal_status(2, "你已关注了") if current_user.watched?(@project)
current_user.watch!(@project)
render_ok
render_ok({watchers_count: @project.watchers_count, watched: current_user.watched?(@project)})
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)