1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Define delete types as constants

This commit is contained in:
kodumbeats 2021-10-25 20:14:55 -04:00
parent f30858f09e
commit c3627cac24
2 changed files with 10 additions and 6 deletions

View file

@ -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';

View file

@ -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: