@appsemble/node-utils
Version:
NodeJS utilities used by Appsemble internally.
14 lines • 614 B
JavaScript
import { assertKoaCondition } from '../../../../../koa.js';
export function createGetAppVariablesController({ getApp, getAppVariables }) {
return async (ctx) => {
const { pathParams: { appId }, } = ctx;
const app = await getApp({ context: ctx, query: { attributes: ['id'], 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