From f70712865e5948490e46238384e7a151ddd72f46 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 May 2023 06:52:27 +0000 Subject: [PATCH] refactor --- app/config/errors.php | 4 ++-- app/controllers/api/projects.php | 4 ++-- src/Appwrite/Extend/Exception.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index f8a5fd8491..87ddce6306 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -524,8 +524,8 @@ return [ 'description' => 'The project key has expired. Please generate a new key using the Appwrite console.', 'code' => 401, ], - Exception::PROJECT_DEFAULT_TEMPLATE_DELETION => [ - 'name' => Exception::PROJECT_DEFAULT_TEMPLATE_DELETION, + Exception::PROJECT_TEMPLATE_DEFAULT_DELETION => [ + 'name' => Exception::PROJECT_TEMPLATE_DEFAULT_DELETION, 'description' => 'The default template for the project cannot be deleted.', 'code' => 401, ], diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 4645cbbc18..20835ca7ad 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1857,7 +1857,7 @@ App::DELETE('/v1/projects/:projectId/templates/sms/:type/:locale') $template = $templates['sms.' . $type . '-' . $locale] ?? null; if (is_null($template)) { - throw new Exception(Exception::PROJECT_DEFAULT_TEMPLATE_DELETION); + throw new Exception(Exception::PROJECT_TEMPLATE_DEFAULT_DELETION); } unset($template['sms.' . $type . '-' . $locale]); @@ -1898,7 +1898,7 @@ App::DELETE('/v1/projects/:projectId/templates/email/:type/:locale') $template = $templates['email.' . $type . '-' . $locale] ?? null; if (is_null($template)) { - throw new Exception(Exception::PROJECT_DEFAULT_TEMPLATE_DELETION); + throw new Exception(Exception::PROJECT_TEMPLATE_DEFAULT_DELETION); } unset($templates['email.' . $type . '-' . $locale]); diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index af65bc952c..0f488d96f9 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -164,7 +164,7 @@ class Exception extends \Exception public const PROJECT_RESERVED_PROJECT = 'project_reserved_project'; public const PROJECT_KEY_EXPIRED = 'project_key_expired'; - public const PROJECT_DEFAULT_TEMPLATE_DELETION = 'project_default_template_deletion'; + public const PROJECT_TEMPLATE_DEFAULT_DELETION = 'project_template_default_deletion'; /** Webhooks */ public const WEBHOOK_NOT_FOUND = 'webhook_not_found';