Closed eleonoreeuzenes closed 2 months ago
Fix du cache testé via postman
Modifications :
if (Cache::has('user_' . $userId)) { $user = User::findOrFail($userId); if ($this->userService->checkIfCanAccessToResource($user->id) && $this->userService->isUserUnblocked($user->id)) { return response()->json(Cache::get('user_' . $userId)); } }
if ($this->userService->checkIfCanAccessToResource($user->id) && $this->userService->isUserUnblocked($user->id)) { Cache::put('user_' . $userId, $user, now()->addMinutes(60)); }
Fix du cache testé via postman
Modifications :
if (Cache::has('user_' . $userId)) { $user = User::findOrFail($userId); if ($this->userService->checkIfCanAccessToResource($user->id) && $this->userService->isUserUnblocked($user->id)) { return response()->json(Cache::get('user_' . $userId)); } }
if ($this->userService->checkIfCanAccessToResource($user->id) && $this->userService->isUserUnblocked($user->id)) { Cache::put('user_' . $userId, $user, now()->addMinutes(60)); }