|
@@ -1556,10 +1556,10 @@ Boards.uniqueTitle = title => {
|
|
);
|
|
);
|
|
const base = escapeForRegex(m.groups.title);
|
|
const base = escapeForRegex(m.groups.title);
|
|
const baseTitle = m.groups.title;
|
|
const baseTitle = m.groups.title;
|
|
- boards = Boards.find({ title: new RegExp(`^${base}\\s*(\\[(?<num>\\d+)]\\s*$|\\s*$)`) });
|
|
|
|
- if (boards.count() > 0) {
|
|
|
|
|
|
+ boards = ReactiveCache.getBoards({ title: new RegExp(`^${base}\\s*(\\[(?<num>\\d+)]\\s*$|\\s*$)`) });
|
|
|
|
+ if (boards.length > 0) {
|
|
let num = 0;
|
|
let num = 0;
|
|
- Boards.find({ title: new RegExp(`^${base}\\s*\\[\\d+]\\s*$`) }).forEach(
|
|
|
|
|
|
+ ReactiveCache.getBoards({ title: new RegExp(`^${base}\\s*\\[\\d+]\\s*$`) }).forEach(
|
|
board => {
|
|
board => {
|
|
const m = board.title.match(
|
|
const m = board.title.match(
|
|
new RegExp('^(?<title>.*?)\\s*\\[(?<num>\\d+)]\\s*$'),
|
|
new RegExp('^(?<title>.*?)\\s*\\[(?<num>\\d+)]\\s*$'),
|
|
@@ -1589,7 +1589,8 @@ Boards.userSearch = (
|
|
if (userId) {
|
|
if (userId) {
|
|
selector.$or.push({ members: { $elemMatch: { userId, isActive: true } } });
|
|
selector.$or.push({ members: { $elemMatch: { userId, isActive: true } } });
|
|
}
|
|
}
|
|
- return Boards.find(selector, projection);
|
|
|
|
|
|
+ const ret = ReactiveCache.getBoards(selector, projection);
|
|
|
|
+ return ret;
|
|
};
|
|
};
|
|
|
|
|
|
Boards.userBoards = (
|
|
Boards.userBoards = (
|
|
@@ -1617,7 +1618,7 @@ Boards.userBoards = (
|
|
{ teams: { $elemMatch: { teamId: { $in: user.teamIds() }, isActive: true } } },
|
|
{ teams: { $elemMatch: { teamId: { $in: user.teamIds() }, isActive: true } } },
|
|
];
|
|
];
|
|
|
|
|
|
- return Boards.find(selector, projection);
|
|
|
|
|
|
+ return ReactiveCache.getBoards(selector, projection);
|
|
};
|
|
};
|
|
|
|
|
|
Boards.userBoardIds = (userId, archived = false, selector = {}) => {
|
|
Boards.userBoardIds = (userId, archived = false, selector = {}) => {
|
|
@@ -1972,7 +1973,7 @@ if (Meteor.isServer) {
|
|
req.userId === paramUserId,
|
|
req.userId === paramUserId,
|
|
);
|
|
);
|
|
|
|
|
|
- const data = Boards.find(
|
|
|
|
|
|
+ const data = ReactiveCache.getBoards(
|
|
{
|
|
{
|
|
archived: false,
|
|
archived: false,
|
|
'members.userId': paramUserId,
|
|
'members.userId': paramUserId,
|
|
@@ -2008,7 +2009,7 @@ if (Meteor.isServer) {
|
|
Authentication.checkUserId(req.userId);
|
|
Authentication.checkUserId(req.userId);
|
|
JsonRoutes.sendResult(res, {
|
|
JsonRoutes.sendResult(res, {
|
|
code: 200,
|
|
code: 200,
|
|
- data: Boards.find(
|
|
|
|
|
|
+ data: ReactiveCache.getBoards(
|
|
{ permission: 'public' },
|
|
{ permission: 'public' },
|
|
{
|
|
{
|
|
sort: { sort: 1 /* boards default sorting */ },
|
|
sort: { sort: 1 /* boards default sorting */ },
|
|
@@ -2040,8 +2041,8 @@ if (Meteor.isServer) {
|
|
JsonRoutes.sendResult(res, {
|
|
JsonRoutes.sendResult(res, {
|
|
code: 200,
|
|
code: 200,
|
|
data: {
|
|
data: {
|
|
- private: Boards.find({ permission: 'private' }).count(),
|
|
|
|
- public: Boards.find({ permission: 'public' }).count(),
|
|
|
|
|
|
+ private: ReactiveCache.getBoards({ permission: 'private' }).length,
|
|
|
|
+ public: ReactiveCache.getBoards({ permission: 'public' }).length,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
} catch (error) {
|
|
} catch (error) {
|