1
0
Fork 0
mirror of synced 2024-05-20 20:52:36 +12:00

Fixed team member count

This commit is contained in:
Eldad Fux 2020-06-08 08:42:01 +03:00
parent 591ff738ee
commit 157b91b63b
3 changed files with 8 additions and 5 deletions

View file

@ -11,6 +11,7 @@
## Bug Fixes
- Fixed output of /v1/health/queue/certificates returning wrong data
- Fixed bug where team members count was wrong in some cases
## Security

View file

@ -584,9 +584,11 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId')
throw new Exception('Failed to remove membership from DB', 500);
}
$team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [
'sum' => $team->getAttribute('sum', 0) - 1,
]));
if ($membership->getAttribute('confirm')) { // Count only confirmed members
$team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [
'sum' => $team->getAttribute('sum', 0) - 1,
]));
}
if (false === $team) {
throw new Exception('Failed saving team to DB', 500);

View file

@ -82,7 +82,7 @@
</div>
<div data-ls-if="0 != {{project-members.sum}}">
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative"><span data-ls-bind="{{project-members.sum}}"></span> members found</div>
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative"><span data-ls-bind="{{project-members.sum}}"></span> memberships found</div>
<div class="box margin-bottom">
<ul data-ls-loop="project-members.memberships" data-ls-as="member" class="list">
@ -153,7 +153,7 @@
<hr />
<div class="clear">
<button>Send Invite</button>
<button>Add Member</button>
&nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</div>
</form>