diff --git a/lib/models/plugins/addCRUDFunctions.js b/lib/models/plugins/addCRUDFunctions.js
index e4e55cd780..75502c5575 100644
--- a/lib/models/plugins/addCRUDFunctions.js
+++ b/lib/models/plugins/addCRUDFunctions.js
@@ -181,7 +181,7 @@ async function getConnection({
query.where(cursorFilter);
} else if (before) {
const cursorFilter = paginationToFilter({
- cursor: after,
+ cursor: before,
sort,
paginationDirection: direction
});
diff --git a/ui/src/pages/SiteUsersPage/SiteUserOrgItems.js b/ui/src/pages/SiteUsersPage/SiteUserOrgItems.js
index 968c9bb6e5..50b94ae3b8 100644
--- a/ui/src/pages/SiteUsersPage/SiteUserOrgItems.js
+++ b/ui/src/pages/SiteUsersPage/SiteUserOrgItems.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Map } from 'immutable';
-import { compose, withProps, setPropTypes } from 'recompose';
+import { compose, setPropTypes, withProps } from 'recompose';
import { withModels } from 'ui/utils/hocs';
import SiteUserOrgItem from './SiteUserOrgItem';
@@ -11,12 +11,12 @@ const enhance = compose(
}),
withProps(({ user }) => {
const schema = 'organisation';
- const organisations = user
- .get('organisations')
- .map(org => new Map({ $oid: org }));
+ const organisations = user.get('organisations').map(org => new Map({ $oid: org }));
+ // Decision made via (https://github.com/LearningLocker/learninglocker/pull/1513#issuecomment-587064642)
+ // Need to change when we will have OrganisationUser model.
const filter = new Map({
_id: new Map({
- $in: organisations
+ $in: organisations.slice(0, 10)
})
});
@@ -25,11 +25,37 @@ const enhance = compose(
withModels
);
-const SiteUserOrgItems = ({ models, user }) => {
- const orgsItems = models
- .map(org =>
Plus { countOfRemainingOrganisations } more not displayed
} +