"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUrgentQuotaAction = exports.urgentApproval = void 0;
var tslib_1 = require("tslib");
exports.urgentApproval = {
    rest: {
        method: 'POST',
        fullPath: '/api/pepsico-content/approve/urgent/:recordId'
    },
    handler: function (ctx) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var user, userId, result;
            return tslib_1.__generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        ctx.getObject = this.getObject;
                        user = ctx.meta.user;
                        userId = user === null || user === void 0 ? void 0 : user.userId;
                        return [4, this.doUrgent(ctx, ctx.params.recordId, userId)];
                    case 1:
                        result = _a.sent();
                        return [2, result];
                }
            });
        });
    }
};
exports.getUrgentQuotaAction = {
    rest: {
        method: 'GET',
        fullPath: '/api/pepsico-content/approve/urgent-quota/:recordId'
    },
    handler: function (ctx) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var user, userId, check;
            return tslib_1.__generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        ctx.getObject = this.getObject;
                        user = ctx.meta.user;
                        userId = user === null || user === void 0 ? void 0 : user.userId;
                        return [4, this.canUrgent(ctx, ctx.params.recordId, userId)];
                    case 1:
                        check = _a.sent();
                        return [2, check];
                }
            });
        });
    }
};
//# sourceMappingURL=urgentApproval.js.map