UBERF-5083: Fix project delete (#4446)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-01-25 17:19:23 +07:00 committed by GitHub
parent 6d31c0f2e5
commit f94cda3cff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,8 @@ import core, {
type Ref,
type RelatedDocument,
toIdMap,
type TxOperations
type TxOperations,
DOMAIN_CONFIGURATION
} from '@hcengineering/core'
import { type Resources, translate } from '@hcengineering/platform'
import { getClient, MessageBox, type ObjectSearchResult } from '@hcengineering/presentation'
@ -303,7 +304,8 @@ async function deleteProject (project: Project | undefined): Promise<void> {
continue
}
const d = h.findDomain(c._id)
if (d !== undefined && d !== DOMAIN_MODEL) {
if (d !== undefined && d !== DOMAIN_MODEL && d !== DOMAIN_CONFIGURATION) {
try {
while (true) {
const docs = await client.findAll(c._id, { space: project._id }, { limit: 50 })
if (docs.length === 0) {
@ -333,6 +335,9 @@ async function deleteProject (project: Project | undefined): Promise<void> {
}
await ops.commit()
}
} catch (err: any) {
console.error(err)
}
}
}
await client.remove(project)