浏览代码

Update BaseApiController

Daniel Supernault 5 年之前
父节点
当前提交
a24b4a40e0
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      app/Http/Controllers/Api/BaseApiController.php

+ 2 - 3
app/Http/Controllers/Api/BaseApiController.php

@@ -48,8 +48,7 @@ class BaseApiController extends Controller
     public function notifications(Request $request)
     {
         abort_if(!$request->user(), 403);
-
-        $pid = Auth::user()->profile->id;
+        $pid = $request->user()->profile_id;
         $pg = $request->input('pg');
         if($pg == true) {
             $timeago = Carbon::now()->subMonths(6);
@@ -62,7 +61,7 @@ class BaseApiController extends Controller
         } else {
             $this->validate($request, [
                 'page' => 'nullable|integer|min:1|max:10',
-                'limit' => 'nullable|integer|min:1|max:10'
+                'limit' => 'nullable|integer|min:1|max:40'
             ]);
             $limit = $request->input('limit') ?? 10;
             $page = $request->input('page') ?? 1;