@kne/fastify-account 1.0.0-alpha.15 → 1.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/services/tenant-org.js +10 -2
- package/package.json +1 -1
|
@@ -17,8 +17,16 @@ module.exports = fp(async (fastify, options) => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const addTenantOrg = async org => {
|
|
20
|
-
if (
|
|
21
|
-
|
|
20
|
+
if (
|
|
21
|
+
await models.tenantOrg.count({
|
|
22
|
+
where: {
|
|
23
|
+
name: org.name,
|
|
24
|
+
pid: org.pid,
|
|
25
|
+
tenantId: org.tenantId
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
) {
|
|
29
|
+
throw new Error('组织名称在同一父组织下有重复');
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
return await models.tenantOrg.create({
|