oak-general-business/lib/triggers/oauthProvider.js

21 lines
723 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const triggers = [
{
name: "创建provider时填充数据",
action: "create",
when: "before",
entity: "oauthProvider",
fn: async ({ operation }, context) => {
(0, assert_1.default)(operation.data && !Array.isArray(operation.data), "oauthProvider create data 必须存在且为单条记录");
const { data } = operation;
const systemId = context.getSystemId();
data.systemId = systemId;
return 0;
}
},
];
exports.default = triggers;