mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
Move every SessionData.findOne(idOrFirstObjectSelector, options) to the ReactiveCache
This commit is contained in:
parent
08e3ca3435
commit
49071ca5fd
3 changed files with 22 additions and 4 deletions
|
|
@ -62,8 +62,8 @@ export class CardSearchPagedComponent extends BlazeComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
getSessionData(sessionId) {
|
getSessionData(sessionId) {
|
||||||
return SessionData.findOne({
|
return ReactiveCache.getSessionData({
|
||||||
sessionId: sessionId ? sessionId : SessionData.getSessionId(),
|
sessionId: sessionId || SessionData.getSessionId(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,14 @@ ReactiveCacheServer = {
|
||||||
const ret = Integrations.find(selector, options).fetch();
|
const ret = Integrations.find(selector, options).fetch();
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getSessionData(idOrFirstObjectSelector, options) {
|
||||||
|
const ret = SessionData.findOne(idOrFirstObjectSelector, options);
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
getSessionDatas(selector, options) {
|
||||||
|
const ret = SessionData.find(selector, options).fetch();
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
getCurrentSetting() {
|
getCurrentSetting() {
|
||||||
const ret = Settings.findOne();
|
const ret = Settings.findOne();
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -996,6 +1004,16 @@ ReactiveCache = {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getSessionData(idOrFirstObjectSelector, options) {
|
||||||
|
// no reactive cache, otherwise global search will not work anymore
|
||||||
|
let ret = ReactiveCacheServer.getSessionData(idOrFirstObjectSelector, options);
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
getSessionDatas(selector, options) {
|
||||||
|
// no reactive cache, otherwise global search will not work anymore
|
||||||
|
let ret = ReactiveCacheServer.getSessionDatas(selector, options);
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
getCurrentSetting() {
|
getCurrentSetting() {
|
||||||
let ret;
|
let ret;
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
|
|
||||||
|
|
@ -648,7 +648,7 @@ Meteor.publish('brokenCards', function(sessionId) {
|
||||||
Meteor.publish('nextPage', function(sessionId) {
|
Meteor.publish('nextPage', function(sessionId) {
|
||||||
check(sessionId, String);
|
check(sessionId, String);
|
||||||
|
|
||||||
const session = SessionData.findOne({ sessionId });
|
const session = ReactiveCache.getSessionData({ sessionId });
|
||||||
const projection = session.getProjection();
|
const projection = session.getProjection();
|
||||||
projection.skip = session.lastHit;
|
projection.skip = session.lastHit;
|
||||||
|
|
||||||
|
|
@ -658,7 +658,7 @@ Meteor.publish('nextPage', function(sessionId) {
|
||||||
Meteor.publish('previousPage', function(sessionId) {
|
Meteor.publish('previousPage', function(sessionId) {
|
||||||
check(sessionId, String);
|
check(sessionId, String);
|
||||||
|
|
||||||
const session = SessionData.findOne({ sessionId });
|
const session = ReactiveCache.getSessionData({ sessionId });
|
||||||
const projection = session.getProjection();
|
const projection = session.getProjection();
|
||||||
projection.skip = session.lastHit - session.resultsCount - projection.limit;
|
projection.skip = session.lastHit - session.resultsCount - projection.limit;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue