1
This commit is contained in:
@@ -1,19 +1,11 @@
|
||||
const logic = require("../service/biz_subscription_logic");
|
||||
const audit = require("../service/biz_audit_service");
|
||||
|
||||
function getRequestBody(ctx) {
|
||||
if (ctx.request && ctx.request.body && Object.keys(ctx.request.body).length > 0) {
|
||||
return ctx.request.body;
|
||||
}
|
||||
if (typeof ctx.getBody === "function") {
|
||||
return ctx.getBody() || {};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
"POST /biz_payment/confirm-offline": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const row = await logic.confirmOfflinePayment(body);
|
||||
await audit.logAudit({
|
||||
admin_user_id: audit.pickAdminId(ctx),
|
||||
@@ -25,7 +17,7 @@ module.exports = {
|
||||
ctx.success(row);
|
||||
},
|
||||
"POST /biz_payment/confirm-link": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const row = await logic.confirmLinkPayment(body);
|
||||
await audit.logAudit({
|
||||
admin_user_id: audit.pickAdminId(ctx),
|
||||
|
||||
Reference in New Issue
Block a user