|
|
@ -16,6 +16,7 @@ import NocoCache from '~/cache/NocoCache'; |
|
|
|
import { parseMetaProp, stringifyMetaProp } from '~/utils/modelUtils'; |
|
|
|
import { parseMetaProp, stringifyMetaProp } from '~/utils/modelUtils'; |
|
|
|
import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; |
|
|
|
import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; |
|
|
|
import { cleanCommandPaletteCache } from '~/helpers/commandPaletteHelpers'; |
|
|
|
import { cleanCommandPaletteCache } from '~/helpers/commandPaletteHelpers'; |
|
|
|
|
|
|
|
import { NcError } from '~/helpers/catchError'; |
|
|
|
|
|
|
|
|
|
|
|
const logger = new Logger('Base'); |
|
|
|
const logger = new Logger('Base'); |
|
|
|
|
|
|
|
|
|
|
@ -399,11 +400,22 @@ export default class Base implements BaseType { |
|
|
|
baseId, |
|
|
|
baseId, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
): Promise<any> { |
|
|
|
): Promise<any> { |
|
|
|
let base = await this.get(context, baseId, ncMeta); |
|
|
|
const base = await ncMeta.metaGet2( |
|
|
|
|
|
|
|
context.workspace_id, |
|
|
|
|
|
|
|
context.base_id, |
|
|
|
|
|
|
|
MetaTable.PROJECT, |
|
|
|
|
|
|
|
baseId, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!base) { |
|
|
|
|
|
|
|
NcError.baseNotFound(baseId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const users = await BaseUser.getUsersList( |
|
|
|
const users = await BaseUser.getUsersList( |
|
|
|
context, |
|
|
|
context, |
|
|
|
{ |
|
|
|
{ |
|
|
|
base_id: baseId, |
|
|
|
base_id: baseId, |
|
|
|
|
|
|
|
include_ws_deleted: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ncMeta, |
|
|
|
ncMeta, |
|
|
|
); |
|
|
|
); |
|
|
@ -412,11 +424,14 @@ export default class Base implements BaseType { |
|
|
|
await BaseUser.delete(context, baseId, user.id, ncMeta); |
|
|
|
await BaseUser.delete(context, baseId, user.id, ncMeta); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const sources = await Source.list(context, { baseId }, ncMeta); |
|
|
|
const sources = await Source.list( |
|
|
|
|
|
|
|
context, |
|
|
|
|
|
|
|
{ baseId, includeDeleted: true }, |
|
|
|
|
|
|
|
ncMeta, |
|
|
|
|
|
|
|
); |
|
|
|
for (const source of sources) { |
|
|
|
for (const source of sources) { |
|
|
|
await source.delete(context, ncMeta); |
|
|
|
await source.delete(context, ncMeta); |
|
|
|
} |
|
|
|
} |
|
|
|
base = await this.get(context, baseId, ncMeta); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (base) { |
|
|
|
if (base) { |
|
|
|
// delete <scope>:<uuid>
|
|
|
|
// delete <scope>:<uuid>
|
|
|
|