mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04: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) {
|
||||
return SessionData.findOne({
|
||||
sessionId: sessionId ? sessionId : SessionData.getSessionId(),
|
||||
return ReactiveCache.getSessionData({
|
||||
sessionId: sessionId || SessionData.getSessionId(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -155,6 +155,14 @@ ReactiveCacheServer = {
|
|||
const ret = Integrations.find(selector, options).fetch();
|
||||
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() {
|
||||
const ret = Settings.findOne();
|
||||
return ret;
|
||||
|
@ -996,6 +1004,16 @@ ReactiveCache = {
|
|||
}
|
||||
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() {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
@ -648,7 +648,7 @@ Meteor.publish('brokenCards', function(sessionId) {
|
|||
Meteor.publish('nextPage', function(sessionId) {
|
||||
check(sessionId, String);
|
||||
|
||||
const session = SessionData.findOne({ sessionId });
|
||||
const session = ReactiveCache.getSessionData({ sessionId });
|
||||
const projection = session.getProjection();
|
||||
projection.skip = session.lastHit;
|
||||
|
||||
|
@ -658,7 +658,7 @@ Meteor.publish('nextPage', function(sessionId) {
|
|||
Meteor.publish('previousPage', function(sessionId) {
|
||||
check(sessionId, String);
|
||||
|
||||
const session = SessionData.findOne({ sessionId });
|
||||
const session = ReactiveCache.getSessionData({ sessionId });
|
||||
const projection = session.getProjection();
|
||||
projection.skip = session.lastHit - session.resultsCount - projection.limit;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue