fix uni-cms-article/schema.ext.js 格式

This commit is contained in:
chenruilong 2023-04-21 15:38:12 +08:00
parent ee8b5113ef
commit 7411eb590e

View File

@ -84,10 +84,7 @@ function safeRequire(module) {
module.exports = {
trigger: {
// 创建文章前触发
beforeCreate: async function ({
clientInfo,
addDataList,
}) {
beforeCreate: async function ({clientInfo, addDataList}) {
// addDataList 是一个数组,因为可以一次性创建多条数据
if (addDataList.length <= 0) return
@ -119,11 +116,7 @@ module.exports = {
}
},
// 更新文章前触发
beforeUpdate: async function ({
clientInfo,
where,
updateData
}) {
beforeUpdate: async function ({clientInfo, where, updateData}) {
const id = where && where._id
if (!id) return