mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Move every Lists.findOne(idOrFirstObjectSelector, options) to the ReactiveCache
This commit is contained in:
parent
ad9daba60d
commit
9e557f6887
7 changed files with 12 additions and 12 deletions
|
|
@ -763,7 +763,7 @@ Boards.helpers({
|
|||
* @returns Document the last list
|
||||
*/
|
||||
getLastList() {
|
||||
const ret = Lists.findOne({ boardId: this._id }, { sort: { sort: 'desc' } });
|
||||
const ret = ReactiveCache.getList({ boardId: this._id }, { sort: { sort: 'desc' } });
|
||||
return ret;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ Lists.helpers({
|
|||
this.swimlaneId = swimlaneId;
|
||||
|
||||
let _id = null;
|
||||
const existingListWithSameName = Lists.findOne({
|
||||
const existingListWithSameName = ReactiveCache.getList({
|
||||
boardId,
|
||||
title: this.title,
|
||||
archived: false,
|
||||
|
|
@ -219,7 +219,7 @@ Lists.helpers({
|
|||
},
|
||||
|
||||
move(boardId, swimlaneId) {
|
||||
const boardList = Lists.findOne({
|
||||
const boardList = ReactiveCache.getList({
|
||||
boardId,
|
||||
title: this.title,
|
||||
archived: false,
|
||||
|
|
@ -534,7 +534,7 @@ if (Meteor.isServer) {
|
|||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: Lists.findOne({
|
||||
data: ReactiveCache.getList({
|
||||
_id: paramListId,
|
||||
boardId: paramBoardId,
|
||||
archived: false,
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ Swimlanes.helpers({
|
|||
|
||||
move(toBoardId) {
|
||||
this.lists().forEach(list => {
|
||||
const toList = Lists.findOne({
|
||||
const toList = ReactiveCache.getList({
|
||||
boardId: toBoardId,
|
||||
title: list.title,
|
||||
archived: false,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ Triggers.helpers({
|
|||
},
|
||||
|
||||
findList(title) {
|
||||
return Lists.findOne({
|
||||
return ReactiveCache.getList({
|
||||
title,
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue