Skip to main content

deleteSchema

Delete an OpenRegister schema.

import { deleteSchema, SchemaHasObjectsError } from '@conduction/nextcloud-vue'

try {
await deleteSchema(id)
} catch (e) {
if (e instanceof SchemaHasObjectsError) {
// Show e.objectCount, then cascade only if the user accepts the data loss:
await deleteSchema(id, { deleteObjects: true })
}
}

Options

OptionTypeDescription
deleteObjectsbooleanAlso delete the schema's objects. Irreversible. Never pass on the first attempt.
headersobjectRequest headers.

Throws SchemaHasObjectsError when objects still use the schema and no cascade was requested. It is deliberately not thrown once deleteObjects was already sent, so a caller cannot re-prompt forever against a server that keeps refusing.

Never sends force — that deletes the schema while orphaning its objects and their table.

See also: saveSchema.