const Schmervice = require('@hapipal/schmervice') module.exports = class ResponseService extends Schmervice.Service { constructor(...args) { super(...args) } /** * Internal method to get list of possible response_keys (questions) * @returns {Array} List of all response_keys */ async getResponseKeys() { const { ResponseKey } = this.server.models() /** Grab every ResponseKey */ const allResponseKeys = await ResponseKey.query() /** Uncomment to dedupe the list just in case */ return [...new Set(allResponseKeys)] } }