From 4e53dbb464145750c4acfdf08cb239e93534925d Mon Sep 17 00:00:00 2001 From: noeamiot Date: Thu, 5 Mar 2020 16:42:19 +0100 Subject: [PATCH 1/6] Fixed 'only' selector for index AssoMember controller --- .../Controllers/v1/Asso/MemberController.php | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/v1/Asso/MemberController.php b/app/Http/Controllers/v1/Asso/MemberController.php index 910d8bfeb..5998ab3a9 100644 --- a/app/Http/Controllers/v1/Asso/MemberController.php +++ b/app/Http/Controllers/v1/Asso/MemberController.php @@ -4,6 +4,7 @@ * * @author Samy Nastuzzi * @author Rémy Huet + * @author Noé Amiot * * @copyright Copyright (c) 2018, SiMDE-UTC * @license GNU GPL-3.0 @@ -125,19 +126,38 @@ public function index(Request $request, string $asso_id): JsonResponse $semester = $this->getSemester($request, $choices); $asso = $this->getAsso($request, $asso_id); - $members = $asso->allMembers() - ->where('semester_id', $semester->id) - ->whereNotNull('role_id') - ->getSelection(true) - ->map(function ($member) { - $member->pivot = [ - 'role_id' => $member->role_id, - 'validated_by_id' => $member->validated_by_id, - 'semester_id' => $member->semester_id, - ]; + $members = collect(); - return $member->hideData(); - }); + // By default, we show all joined. + if (in_array('joined', $choices)) { + $members = $members->merge($asso->members() + ->where('semester_id', $semester->id) + ->whereNotNull('role_id') + ->getSelection(true) + ->map(function ($member) { + $member->pivot = [ + 'role_id' => $member->role_id, + 'validated_by_id' => $member->validated_by_id, + 'semester_id' => $member->semester_id, + ]; + return $member->hideData(); + })); + } + + if (in_array('joining', $choices)) { + $members = $members->merge($asso->joiners() + ->where('semester_id', $semester->id) + ->whereNotNull('role_id') + ->getSelection(true) + ->map(function ($member) { + $member->pivot = [ + 'role_id' => $member->role_id, + 'validated_by_id' => $member->validated_by_id, + 'semester_id' => $member->semester_id, + ]; + return $member->hideData(); + })); + } return response()->json($members, 200); } From d504fa1b79773e85714480d1e4f2ac18e3030b3f Mon Sep 17 00:00:00 2001 From: noeamiot Date: Fri, 6 Mar 2020 08:56:11 +0100 Subject: [PATCH 2/6] AssoMember index no longer returns unvalidated relations --- app/Http/Controllers/v1/Asso/MemberController.php | 2 +- app/Http/Controllers/v1/Controller.php | 8 +++++++- app/Traits/Controller/v1/HasAssos.php | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/v1/Asso/MemberController.php b/app/Http/Controllers/v1/Asso/MemberController.php index 5998ab3a9..66bea06ab 100644 --- a/app/Http/Controllers/v1/Asso/MemberController.php +++ b/app/Http/Controllers/v1/Asso/MemberController.php @@ -122,7 +122,7 @@ protected function addRolesAndPermissions(Asso $asso, User $member) */ public function index(Request $request, string $asso_id): JsonResponse { - $choices = $this->getChoices($request); + $choices = $this->getChoices($request, ["joined", "joining"], ["joined"]); $semester = $this->getSemester($request, $choices); $asso = $this->getAsso($request, $asso_id); diff --git a/app/Http/Controllers/v1/Controller.php b/app/Http/Controllers/v1/Controller.php index 815e3d2d5..39c9699bc 100644 --- a/app/Http/Controllers/v1/Controller.php +++ b/app/Http/Controllers/v1/Controller.php @@ -3,6 +3,7 @@ * V1 controller. * * @author Samy Nastuzzi + * @author Noé Amiot * * @copyright Copyright (c) 2018, SiMDE-UTC * @license GNU GPL-3.0 @@ -32,10 +33,11 @@ class Controller extends BaseController * * @param Request $request * @param array $choices + * @param array $defaultChoices * @return array * @throws PortailException For bad $choices. */ - protected function getChoices(Request $request, array $choices) + protected function getChoices(Request $request, array $choices, array $defaultChoices=[]) { $only = $request->input('only') ? explode(',', $request->input('only')) : []; $except = $request->input('except') ? explode(',', $request->input('except')) : []; @@ -45,6 +47,10 @@ protected function getChoices(Request $request, array $choices) throw new PortailException('Il n\'est possible de spécifier uniquement: '.implode(', ', $choices)); } + if(empty($only) && empty($except)) { + return $defaultChoices; + } + if (count($only) > 0) { $choices = $only; } diff --git a/app/Traits/Controller/v1/HasAssos.php b/app/Traits/Controller/v1/HasAssos.php index 18b65f648..a0b027a82 100644 --- a/app/Traits/Controller/v1/HasAssos.php +++ b/app/Traits/Controller/v1/HasAssos.php @@ -3,6 +3,7 @@ * Add the controller an access to Associations. * * @author Samy Nastuzzi + * @author Noé Amiot * * @copyright Copyright (c) 2018, SiMDE-UTC * @license GNU GPL-3.0 @@ -66,12 +67,14 @@ protected function getSemester(Request $request, array $choices, string $verb='g * * @param Request $request * @param array $initialChoices + * @param array $defaultChoices * @return array */ - protected function getChoices(Request $request, array $initialChoices=['joined', 'joining']) + protected function getChoices(Request $request, array $initialChoices=['joined', 'joining'], array $defaultChoices=[]) { $scopeHead = \Scopes::getTokenType($request); $choices = []; + $askedDefaultChoices = []; foreach ($initialChoices as $choice) { if (\Scopes::hasOne($request, $scopeHead.'-get-assos-members-'.$choice.'-now')) { @@ -79,7 +82,14 @@ protected function getChoices(Request $request, array $initialChoices=['joined', } } - return parent::getChoices($request, $choices); + foreach ($defaultChoices as $choice) { + if(!in_array($choice, $choices)) + throw new PortailException('Les choix demandés ne peuvent qu\'appartienir à: '.implode(', ', $choices)); + + $askedDefaultChoices[] = $choice; + } + + return parent::getChoices($request, $choices, $askedDefaultChoices); } /** From 51577b0a8d9e33674d29b13e7ee514172e6584db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20AMIOT?= Date: Mon, 2 Mar 2020 23:13:37 +0100 Subject: [PATCH 3/6] Added icon for unvalidated associations sidebar + fixed asso visibility in career --- resources/assets/react/components/Sidebar.js | 4 +++- resources/assets/react/screens/Profile/AssociativeCareer.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/assets/react/components/Sidebar.js b/resources/assets/react/components/Sidebar.js index 1a16d9d86..9f83f76b5 100644 --- a/resources/assets/react/components/Sidebar.js +++ b/resources/assets/react/components/Sidebar.js @@ -4,6 +4,7 @@ * @author Alexandre Brasseur * @author Samy Nastuzzi * @author Natan Danous + * @author Noé Amiot * * @copyright Copyright (c) 2018, SiMDE-UTC * @license GNU GPL-3.0 @@ -29,12 +30,13 @@ class Sidebar extends React.Component { static getAssos(assos) { return assos.map(asso => { let color = `color-${asso.login}`; + const icon = asso.pivot.role_id ? 'hourglass' : 'thumbs-up'; if (asso.parent) color += ` color-${asso.parent.login}`; return ( - {' '} + {' '} {asso.shortname} ); diff --git a/resources/assets/react/screens/Profile/AssociativeCareer.js b/resources/assets/react/screens/Profile/AssociativeCareer.js index 3f9472340..97c99362e 100644 --- a/resources/assets/react/screens/Profile/AssociativeCareer.js +++ b/resources/assets/react/screens/Profile/AssociativeCareer.js @@ -43,7 +43,7 @@ class AssociativeCareerScreen extends React.Component { semesters.forEach(semester => { if (associativeSemesters[semester.id] === undefined) { actions.user.assos - .all({ cemetery: true, semester: semester.id }) + .all({ cemetery: true, semester: semester.id, only: 'joined' }) .payload.then(({ data }) => { if (data.length > 0) { this.addNewAssociativeSemester(semester.id, data); From b63d2be1c1bb0c68a5cd00a9fc88effda60107b0 Mon Sep 17 00:00:00 2001 From: noeamiot Date: Tue, 3 Mar 2020 12:01:13 +0100 Subject: [PATCH 4/6] clarified side bar by moving usefull links + clarified followed associations in career --- resources/assets/react/components/Sidebar.js | 56 +++++++++---------- .../screens/Profile/AssociativeCareer.js | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/resources/assets/react/components/Sidebar.js b/resources/assets/react/components/Sidebar.js index 9f83f76b5..96ec1cbcf 100644 --- a/resources/assets/react/components/Sidebar.js +++ b/resources/assets/react/components/Sidebar.js @@ -94,6 +94,34 @@ class Sidebar extends React.Component { +
+
+ RACCOURCIS{' '} + +
+ {isAuthenticated && user.types.contributorBde && ( + + Réservations + + )} + + Services + + + Associations + + + Partenaires + + + Groupes + +
+
LIENS UTILES{' '} @@ -154,34 +182,6 @@ class Sidebar extends React.Component {
-
-
- RACCOURCIS{' '} - -
- {isAuthenticated && user.types.contributorBde && ( - - Réservations - - )} - - Services - - - Associations - - - Partenaires - - - Groupes - -
- {isAuthenticated && services.length > 0 && (
diff --git a/resources/assets/react/screens/Profile/AssociativeCareer.js b/resources/assets/react/screens/Profile/AssociativeCareer.js index 97c99362e..1b6d11e67 100644 --- a/resources/assets/react/screens/Profile/AssociativeCareer.js +++ b/resources/assets/react/screens/Profile/AssociativeCareer.js @@ -43,7 +43,7 @@ class AssociativeCareerScreen extends React.Component { semesters.forEach(semester => { if (associativeSemesters[semester.id] === undefined) { actions.user.assos - .all({ cemetery: true, semester: semester.id, only: 'joined' }) + .all({ cemetery: true, semester: semester.id, only: 'joined,followed' }) .payload.then(({ data }) => { if (data.length > 0) { this.addNewAssociativeSemester(semester.id, data); @@ -87,7 +87,7 @@ class AssociativeCareerScreen extends React.Component { key={asso.id + semester.id} name={asso.name} shortname={asso.shortname} - additionalInfo={role ? role.name : ''} + additionalInfo={role ? role.name : 'Association suivie'} image={asso.image} login={asso.parent ? asso.parent.login : asso.login} deleted={asso.in_cemetery_at != null} From 6cd7cf4cf43b747ad2fe03519b48acae9283eb1a Mon Sep 17 00:00:00 2001 From: noeamiot Date: Fri, 6 Mar 2020 19:22:33 +0100 Subject: [PATCH 5/6] AssoMember & UserAsso controllers no longer returns unvalidated relations + front adaptation --- .../Controllers/v1/Asso/MemberController.php | 32 +++++++++++++++++-- app/Http/Controllers/v1/Controller.php | 4 +-- .../Controllers/v1/User/AssoController.php | 2 +- app/Traits/Controller/v1/HasAssos.php | 6 ++-- app/Traits/Model/HasMembers.php | 3 +- resources/assets/react/AppLoader.js | 2 +- resources/assets/react/screens/Asso/index.js | 14 ++++---- 7 files changed, 44 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/v1/Asso/MemberController.php b/app/Http/Controllers/v1/Asso/MemberController.php index 66bea06ab..d6b766f03 100644 --- a/app/Http/Controllers/v1/Asso/MemberController.php +++ b/app/Http/Controllers/v1/Asso/MemberController.php @@ -122,7 +122,7 @@ protected function addRolesAndPermissions(Asso $asso, User $member) */ public function index(Request $request, string $asso_id): JsonResponse { - $choices = $this->getChoices($request, ["joined", "joining"], ["joined"]); + $choices = $this->getChoices($request, ["joined", "joining", "followed"], ["joined"]); $semester = $this->getSemester($request, $choices); $asso = $this->getAsso($request, $asso_id); @@ -159,6 +159,20 @@ public function index(Request $request, string $asso_id): JsonResponse })); } + if (in_array('followed', $choices)) { + $members = $members->merge($asso->followers() + ->where('semester_id', $semester->id) + ->getSelection(true) + ->map(function ($member) { + $member->pivot = [ + 'role_id' => $member->role_id, + 'validated_by_id' => $member->validated_by_id, + 'semester_id' => $member->semester_id, + ]; + return $member->hideData(); + })); + } + return response()->json($members, 200); } @@ -197,12 +211,24 @@ public function store(AssoMemberRequest $request, string $asso_id): JsonResponse */ public function show(Request $request, string $asso_id, string $member_id): JsonResponse { - $choices = $this->getChoices($request); + $choices = $this->getChoices($request, ["joined", "joining", "followed"], ["joined"]); $semester = $this->getSemester($request, $choices); $asso = $this->getAsso($request, $asso_id); $user = $this->getUserFromAsso($request, $asso, $member_id, $semester); - return response()->json($user->hideData(), 200); + if (in_array('joined', $choices) + && !is_null($user["pivot"]["validated_by_id"]) + && !is_null($user["pivot"]["role_id"])) { + return response()->json($user->hideData(), 200); + } else if (in_array('joining', $choices) + && is_null($user["pivot"]["validated_by_id"]) + && !is_null($user["pivot"]["role_id"])) { + return response()->json($user->hideData(), 200); + } else if (in_array('followed', $choices) && $user["pivot"]["role_id"] == null) { + return response()->json($user->hideData(), 200); + } + + return response()->json([], 200); } /** diff --git a/app/Http/Controllers/v1/Controller.php b/app/Http/Controllers/v1/Controller.php index 39c9699bc..a752e4b84 100644 --- a/app/Http/Controllers/v1/Controller.php +++ b/app/Http/Controllers/v1/Controller.php @@ -47,8 +47,8 @@ protected function getChoices(Request $request, array $choices, array $defaultCh throw new PortailException('Il n\'est possible de spécifier uniquement: '.implode(', ', $choices)); } - if(empty($only) && empty($except)) { - return $defaultChoices; + if (empty($only) && empty($except)) { + return $defaultChoices; } if (count($only) > 0) { diff --git a/app/Http/Controllers/v1/User/AssoController.php b/app/Http/Controllers/v1/User/AssoController.php index c6b1d2a16..6070b4802 100644 --- a/app/Http/Controllers/v1/User/AssoController.php +++ b/app/Http/Controllers/v1/User/AssoController.php @@ -65,7 +65,7 @@ public function __construct() public function index(Request $request, string $user_id=null): JsonResponse { $user = $this->getUser($request, $user_id); - $choices = $this->getChoices($request, ['joined', 'joining', 'followed']); + $choices = $this->getChoices($request, ['joined', 'joining', 'followed'], ["joined"]); $semester = $this->getSemester($request, $choices); $assos = collect(); diff --git a/app/Traits/Controller/v1/HasAssos.php b/app/Traits/Controller/v1/HasAssos.php index a0b027a82..cce4e61a9 100644 --- a/app/Traits/Controller/v1/HasAssos.php +++ b/app/Traits/Controller/v1/HasAssos.php @@ -83,8 +83,9 @@ protected function getChoices(Request $request, array $initialChoices=['joined', } foreach ($defaultChoices as $choice) { - if(!in_array($choice, $choices)) - throw new PortailException('Les choix demandés ne peuvent qu\'appartienir à: '.implode(', ', $choices)); + if (!in_array($choice, $choices)) { + throw new PortailException('Les choix demandés ne peuvent qu\'appartienir à: '.implode(', ', $choices)); + } $askedDefaultChoices[] = $choice; } @@ -137,7 +138,6 @@ protected function getUserFromAsso(Request $request, Asso $asso, string $user_id $user = $asso->allMembers() ->wherePivot('user_id', $this->getUser($request, $user_id, true)->id) ->wherePivot('semester_id', $semester ? $semester->id : Semester::getThisSemester()) - ->whereNotNull('role_id') ->first(); if ($user) { diff --git a/app/Traits/Model/HasMembers.php b/app/Traits/Model/HasMembers.php index 33847dcb3..6fda193f0 100644 --- a/app/Traits/Model/HasMembers.php +++ b/app/Traits/Model/HasMembers.php @@ -82,8 +82,7 @@ public function currentAllMembers() public function members() { return $this->belongsToMany(User::class, $this->getMemberRelationTable()) - ->whereNotNull('validated_by_id') - ->withPivot('semester_id', 'role_id', 'validated_by_id', 'created_at', 'updated_at'); + ->withPivot('semester_id', 'role_id', 'validated_by_id', 'created_at', 'updated_at'); } /** diff --git a/resources/assets/react/AppLoader.js b/resources/assets/react/AppLoader.js index d8458134a..87a646295 100644 --- a/resources/assets/react/AppLoader.js +++ b/resources/assets/react/AppLoader.js @@ -53,7 +53,7 @@ class AppLoader extends React.Component { // User permissions retrievement. dispatch(actions.user.permissions.all()); // User associations retrievement. - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); // User services retrievement. dispatch(actions.user.services.all()); diff --git a/resources/assets/react/screens/Asso/index.js b/resources/assets/react/screens/Asso/index.js index c13effeb3..f661b8155 100644 --- a/resources/assets/react/screens/Asso/index.js +++ b/resources/assets/react/screens/Asso/index.js @@ -157,7 +157,7 @@ class AssoScreen extends React.Component { } ) .payload.then(() => { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.assos(asso.id).members.all()); NotificationManager.success( `Vous suivez maintenant l'association: ${asso.name}`, @@ -201,7 +201,7 @@ class AssoScreen extends React.Component { actions.user.assos .remove(asso.id) .payload.then(() => { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.assos(asso.id).members.all()); NotificationManager.warning( `Vous ne suivez plus l'association: ${asso.name}`, @@ -283,7 +283,7 @@ class AssoScreen extends React.Component { .payload.then(({ data: { id: member_id } }) => { const { user, asso } = this.props; - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.assos(asso.id).members.all()); NotificationManager.success( `Vous avez demandé à rejoindre l'association: ${asso.name}`, @@ -301,7 +301,7 @@ class AssoScreen extends React.Component { ); if (user.id === member_id) { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.user.permissions.all()); } }) @@ -357,7 +357,7 @@ class AssoScreen extends React.Component { .assos(asso.id) .members.remove(user.id) .payload.then(() => { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.assos(asso.id).members.all()); NotificationManager.warning( `Vous ne faites plus partie de l'association: ${name}`, @@ -414,7 +414,7 @@ class AssoScreen extends React.Component { ); if (user.id === member_id) { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.user.permissions.all()); } }) @@ -459,7 +459,7 @@ class AssoScreen extends React.Component { .assos(asso.id) .members.remove(member_id) .payload.then(() => { - dispatch(actions.user.assos.all()); + dispatch(actions.user.assos.all({ only: 'joined,joining,followed' })); dispatch(actions.assos(asso.id).members.all()); NotificationManager.warning( `Vous avez retiré avec succès le membre de cette association: ${name}`, From 6ed210de40a61fa60ba00bb5f7423a0f2fca2b7c Mon Sep 17 00:00:00 2001 From: noeamiot Date: Tue, 10 Mar 2020 14:44:48 +0100 Subject: [PATCH 6/6] AssoAccess controller no longer returns unvalidated relations + front adaptation --- .../Controllers/v1/Asso/AccessController.php | 20 ++++++++++++++++--- resources/assets/react/screens/Asso/Access.js | 13 ++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/v1/Asso/AccessController.php b/app/Http/Controllers/v1/Asso/AccessController.php index 33bf01287..e09f02072 100644 --- a/app/Http/Controllers/v1/Asso/AccessController.php +++ b/app/Http/Controllers/v1/Asso/AccessController.php @@ -6,6 +6,7 @@ * TODO: Missing Scopes ! * * @author Samy Nastuzzi + * @author Noé Amiot * * @copyright Copyright (c) 2018, SiMDE-UTC * @license GNU GPL-3.0 @@ -105,7 +106,7 @@ protected function getAccess(Request $request, string $access_id, string $user_i */ public function index(Request $request, string $asso_id): JsonResponse { - $choices = $this->getChoices($request); + $choices = $this->getChoices($request, ["joined", "joining"], ["joined"]); $semester = $this->getSemester($request, $choices); $asso = $this->getAsso($request, $asso_id, \Auth::user(), $semester); $access = $asso->access()->where('semester_id', $semester->id); @@ -116,6 +117,12 @@ public function index(Request $request, string $asso_id): JsonResponse }); } + if (in_array('joining', $choices) && count($choices) <= 1) { + $access = $access->whereNull('validated_by_id'); + } else if (in_array('joined', $choices) && count($choices) <= 1) { + $access = $access->whereNotNull('validated_by_id'); + } + $access = $access->getSelection() ->map(function ($access) { return $access->hideData(); @@ -179,13 +186,20 @@ public function store(AccessRequest $request, string $asso_id): JsonResponse */ public function show(Request $request, string $asso_id, string $access_id): JsonResponse { - $choices = $this->getChoices($request); + $choices = $this->getChoices($request, ["joined", "joining"], ["joined"]); $semester = $this->getSemester($request, $choices); $user_id = (\Auth::id() ?? $request->input('user_id')); $asso = $this->getAsso($request, $asso_id, \Auth::user(), $semester); $access = $this->getAccess($request, $access_id, $user_id, $asso, $semester->id); + $validated = (isset($access["validated"]) && $access["validated"]); + + if (in_array('joined', $choices) && $validated) { + return response()->json($access->hideSubData(), 200); + } else if (in_array('joining', $choices) && !$validated) { + return response()->json($access->hideSubData(), 200); + } - return response()->json($access->hideSubData(), 200); + return response()->json([], 200); } /** diff --git a/resources/assets/react/screens/Asso/Access.js b/resources/assets/react/screens/Asso/Access.js index 68e8cce63..4453f3b74 100644 --- a/resources/assets/react/screens/Asso/Access.js +++ b/resources/assets/react/screens/Asso/Access.js @@ -2,6 +2,7 @@ * Display the access demands of an association. * * @author Samy Nastuzzi + * @author Noé Amiot * * @copyright Copyright (c) 2019, SiMDE-UTC * @license GNU GPL-3.0 @@ -61,7 +62,7 @@ class AccessScreen extends React.Component { } if (!accessFetched) { - dispatch(actions.access.all()); + dispatch(actions.access.all({ only: 'joined,joining' })); } dispatch(actions.config({ title: `${shortname} - Accès` })); @@ -70,7 +71,7 @@ class AccessScreen extends React.Component { loadAssosData(id) { const { dispatch } = this.props; - dispatch(actions.assos(id).access.all()); + dispatch(actions.assos(id).access.all({ only: 'joined,joining' })); } sendDemand(data) { @@ -80,7 +81,7 @@ class AccessScreen extends React.Component { .assos(asso.id) .access.create(data) .payload.then(({ data: { id: access_id } }) => { - dispatch(actions.assos(asso.id).access.all()); + dispatch(actions.assos(asso.id).access.all({ only: 'joined,joining' })); NotificationManager.success( "La demande d'accès a été envoyée. En attente de la confirmation d'un responsable de l'association", "Demande d'accès" @@ -95,7 +96,7 @@ class AccessScreen extends React.Component { .access(access_id) .update() .payload.then(() => { - dispatch(actions.assos(asso.id).access.all()); + dispatch(actions.assos(asso.id).access.all({ only: 'joined,joining' })); NotificationManager.success( "La demande d'accès a été automatiquement confirmée. En attente de validation de l'accès", "Demande d'accès" @@ -127,7 +128,7 @@ class AccessScreen extends React.Component { .access(acces.id) .update() .payload.then(() => { - dispatch(actions.assos(asso.id).access.all()); + dispatch(actions.assos(asso.id).access.all({ only: 'joined,joining' })); NotificationManager.success( "La demande d'accès a été confirmée. En attente de validation de l'accès", "Demande d'accès" @@ -149,7 +150,7 @@ class AccessScreen extends React.Component { .access(acces.id) .delete() .payload.then(() => { - dispatch(actions.assos(asso.id).access.all()); + dispatch(actions.assos(asso.id).access.all({ only: 'joined,joining' })); NotificationManager.success("La demande d'accès a été annulée", "Demande d'accès"); }) .catch(() => {