Commit b3374626 authored by ml's avatar ml

逻辑调整

parent 50e8f611
......@@ -79,7 +79,7 @@ export const add = async (infoVO: I18nInfoVO, currentUserId: any, ip: any) => {
},
raw: true
});
if (dbInfo){
if (dbInfo) {
throw ErrorCode.DATA_EXIST;
}
await i18nInfo.prototype.create(infoVO);
......@@ -101,6 +101,20 @@ export const update = async (infoVO: I18nInfoVO, currentUserId: any, ip: any) =>
if (!dbOneI18nInfo) {
throw ErrorCode.DATA_NOT_EXIST;
}
//查询是否有重复的
let dbInfo = await i18nInfo.prototype.findOne({
where: {
platform: infoVO.platform,
module: infoVO.module,
code: infoVO.code,
lang: infoVO.lang,
id: { [ormDB.Op.ne]: infoVO.id }
},
raw: true
});
if (dbInfo) {
throw ErrorCode.DATA_EXIST;
}
delete infoVO.id;
let i18nInfoLogOne = await buildOneI18nInfoLog(dbOneI18nInfo, infoVO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment