Define delete types as constants
This commit is contained in:
parent
f30858f09e
commit
c3627cac24
|
@ -93,6 +93,11 @@ const DATABASE_TYPE_DELETE_ATTRIBUTE = 'deleteAttribute';
|
|||
const DATABASE_TYPE_DELETE_INDEX = 'deleteIndex';
|
||||
// Deletion Types
|
||||
const DELETE_TYPE_DOCUMENT = 'document';
|
||||
const DELETE_TYPE_COLLECTIONS = 'collections';
|
||||
const DELETE_TYPE_PROJECTS = 'projects';
|
||||
const DELETE_TYPE_FUNCTIONS = 'functions';
|
||||
const DELETE_TYPE_USERS = 'users';
|
||||
const DELETE_TYPE_TEAMS= 'teams';
|
||||
const DELETE_TYPE_EXECUTIONS = 'executions';
|
||||
const DELETE_TYPE_AUDIT = 'audit';
|
||||
const DELETE_TYPE_ABUSE = 'abuse';
|
||||
|
|
|
@ -38,20 +38,19 @@ class DeletesV1 extends Worker
|
|||
$document = new Document($document);
|
||||
|
||||
switch ($document->getCollection()) {
|
||||
// TODO@kodumbeats define these as constants somewhere
|
||||
case 'collections':
|
||||
case DELETE_TYPE_COLLECTIONS:
|
||||
$this->deleteCollection($document, $projectId);
|
||||
break;
|
||||
case 'projects':
|
||||
case DELETE_TYPE_PROJECTS:
|
||||
$this->deleteProject($document);
|
||||
break;
|
||||
case 'functions':
|
||||
case DELETE_TYPE_FUNCTIONS:
|
||||
$this->deleteFunction($document, $projectId);
|
||||
break;
|
||||
case 'users':
|
||||
case DELETE_TYPE_USERS:
|
||||
$this->deleteUser($document, $projectId);
|
||||
break;
|
||||
case 'teams':
|
||||
case DELETE_TYPE_TEAMS:
|
||||
$this->deleteMemberships($document, $projectId);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue