"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.submitPreReview = void 0;
var tslib_1 = require("tslib");
exports.submitPreReview = {
    rest: {
        method: 'POST',
        fullPath: '/api/pepsico-content/approve/pre-review/submit/:recordId'
    },
    handler: function (ctx) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var logger, approvalStatus;
            return tslib_1.__generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        ctx.getObject = this.getObject;
                        return [4, this.getLogger()];
                    case 1:
                        logger = _a.sent();
                        ctx.logger = logger;
                        approvalStatus = ctx.params.approvalStatus;
                        if (approvalStatus !== 'approved' && approvalStatus !== 'rejected') {
                            throw new Error('无效的审核状态, 必须是 approved 或 rejected');
                        }
                        return [4, this.submitPreReviewContent(ctx, ctx.params.recordId, approvalStatus)];
                    case 2:
                        _a.sent();
                        return [2, {}];
                }
            });
        });
    }
};
//# sourceMappingURL=submitPreReview.js.map