gq 8 gadi atpakaļ
vecāks
revīzija
aee9e228eb

+ 4 - 5
server/app/Http/Controllers/Api/V1/DreamController.php

xqd xqd
@@ -355,7 +355,9 @@ class DreamController extends Controller
      *      "status": true,
      *      "status_code": 0,
      *      "message": "",
-     *      "data": 1         is_collection  关注值
+     *     "data": {
+     *          "is_collection": 1       1已关注 0 未关注
+     *      }
      *}
      * @apiErrorExample {json} Error-Response:
      *HTTP/1.1 400 Bad Request
@@ -395,14 +397,11 @@ class DreamController extends Controller
             if (empty($user_care_dream)) {
                 UserCareDream::create($data);
             }
-            $is_collection = 0 ;
-            return $this->api(compact('is_collection'));
         }else{
             UserCareDream::where('user_id',$user->id)->
             where('dream_id',$request->id)->delete();
-            $is_collection = 1 ;
-            return $this->api(compact('is_collection'));
         }
+        return $this->api(compact('is_collection'));
 
     }