UNPKG

@appsemble/node-utils

Version:

NodeJS utilities used by Appsemble internally.

14 lines 594 B
import { assertKoaCondition } from '../../../../../koa.js'; export function createGetAppVariablesController({ getApp, getAppVariables }) { return async (ctx) => { const { pathParams: { appId }, } = ctx; const app = await getApp({ context: ctx, query: { where: { id: appId } } }); assertKoaCondition(app != null, ctx, 404, 'App not found'); ctx.body = await getAppVariables({ context: ctx, app, query: { attributes: ['id', 'name', 'value'] }, }); }; } //# sourceMappingURL=createGetAppVariablesController.js.map