UNPKG

@63pokupki/nodejs-common

Version:
19 lines 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function RequestSysMiddleware(ctx) { const errorSys = ctx.sys.errorSys; if (ctx.method === 'POST') { if (ctx.body.data) { try { ctx.body.data = JSON.parse(ctx.body.data); } catch (e) { errorSys.errorEx(e, 'data', 'Неправильный формат входных данных'); ctx.body.data = null; } } } ctx.next(); } exports.default = RequestSysMiddleware; //# sourceMappingURL=RequestSysMiddleware.js.map