Files
overleaf-cep/services/web/app/src/Features/Survey/SurveyCache.js
T
Alexandre Bourdin 3d26c4bb6f [web] Add new admin tool for surveys (#8356)
* Setup survey module and admin page skeleton

* Replace survey staff access permission with admin-only

* Manage survey config with admin tool

* Display configurable survey in project list + add preview in admin

* Fix linting errors and unit tests

* Add acceptance tests for survey module

* Move survey-form to survey components

* Add configuration option for Recurly group subscription users on surveys

* Change survey pre-link text to a lighter gray for accessibility

* Cleanup survey options implementation after review

GitOrigin-RevId: 8f621951efeae458d1ab081fe98b8d0d539cca1a
2022-06-23 08:02:37 +00:00

26 lines
497 B
JavaScript

const SurveyManager = require('./SurveyManager')
const { Survey } = require('../../models/Survey')
const { CacheLoader } = require('cache-flow')
class SurveyCache extends CacheLoader {
constructor() {
super('survey', {
expirationTime: 60, // 1min in seconds
})
}
async load() {
return await SurveyManager.getSurvey()
}
serialize(value) {
return value?.toObject()
}
deserialize(value) {
return new Survey(value)
}
}
module.exports = new SurveyCache()