Browse Source

Update StatusController, invalidate profile embed cache on status delete

Daniel Supernault 4 năm trước cách đây
mục cha
commit
9c8a87c331
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      app/Http/Controllers/StatusController.php

+ 7 - 0
app/Http/Controllers/StatusController.php

@@ -74,6 +74,12 @@ class StatusController extends Controller
         }
 
         $template = $status->in_reply_to_id ? 'status.reply' : 'status.show';
+        // $template = $status->type === 'video' &&
+        //     $request->has('video_beta') && 
+        //     $request->video_beta == 1 &&
+        //     $request->user() ?
+        //     'status.show_video' : 'status.show';
+
         return view($template, compact('user', 'status'));
     }
 
@@ -212,6 +218,7 @@ class StatusController extends Controller
 
         Cache::forget('_api:statuses:recent_9:' . $status->profile_id);
         Cache::forget('profile:status_count:' . $status->profile_id);
+        Cache::forget('profile:embed:' . $status->profile_id);
         StatusService::del($status->id);
         if ($status->profile_id == $user->profile->id || $user->is_admin == true) {
             Cache::forget('profile:status_count:'.$status->profile_id);