From 72139b4ee4807c8cc64a5ec677572e9eb6fe07dc Mon Sep 17 00:00:00 2001 From: Ste Vaidis Date: Tue, 29 Oct 2024 14:57:20 +0200 Subject: [PATCH] minor fixes --- .../endpoint_get_AAAAA/endpoint_get_AAAAA.routing.yml | 2 +- .../src/Controller/NodeController.php | 4 ++-- .../src/Controller/NodesController.php | 4 ++-- toolbox/backup.sh | 8 +++++--- toolbox/db.sh | 10 +++++----- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/endpoints/endpoint_get_AAAAA/endpoint_get_AAAAA.routing.yml b/endpoints/endpoint_get_AAAAA/endpoint_get_AAAAA.routing.yml index c07e1f1..b63ee4e 100644 --- a/endpoints/endpoint_get_AAAAA/endpoint_get_AAAAA.routing.yml +++ b/endpoints/endpoint_get_AAAAA/endpoint_get_AAAAA.routing.yml @@ -10,7 +10,7 @@ endpoint_get_AAAAA.node: no_cache: 'TRUE' endpoint_get_AAAAA.nodes: - path: '/api/{lang}/AAAAAs' + path: '/api/{lang}/AAAAA' defaults: _controller: 'Drupal\endpoint_get_AAAAA\Controller\NodesController::getNodes' diff --git a/endpoints/endpoint_get_AAAAA/src/Controller/NodeController.php b/endpoints/endpoint_get_AAAAA/src/Controller/NodeController.php index ea24644..042f0a2 100644 --- a/endpoints/endpoint_get_AAAAA/src/Controller/NodeController.php +++ b/endpoints/endpoint_get_AAAAA/src/Controller/NodeController.php @@ -39,8 +39,8 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa $this->fileUrlGenerator = $fileUrlGenerator; } - private const FIELD_CATEGORY = 'field_AAAAA_category'; // Editable - private const FIELD_SUBCATEGORY = 'field_AAAAA_subcategory'; // Editable + private const FIELD_CATEGORY = 'field_category'; // Editable + private const FIELD_SUBCATEGORY = 'field_subcategory'; // Editable private const HTTP_BAD_REQUEST = 400; private const HTTP_NOT_FOUND = 404; diff --git a/endpoints/endpoint_get_AAAAA/src/Controller/NodesController.php b/endpoints/endpoint_get_AAAAA/src/Controller/NodesController.php index efe77c6..812ec75 100644 --- a/endpoints/endpoint_get_AAAAA/src/Controller/NodesController.php +++ b/endpoints/endpoint_get_AAAAA/src/Controller/NodesController.php @@ -46,14 +46,14 @@ class NodesController extends ControllerBase implements ContainerInjectionInterf * Url : optional URL argument - single value * Example : /api/en/articles/1234 */ - private const FIELD_CATEGORY = 'field_AAAAA_category'; // Editable + private const FIELD_CATEGORY = 'field_category'; // Editable /* Used for : Taxonomy reference field * Value : multiple ID's of field_article_subcategory values * Url : optional URL query params - accept multiple values * Example : /api/en/articles/1234?subcategory=55,66,77 */ - private const FIELD_SUBCATEGORY = 'field_AAAAA_subcategory'; // Editable + private const FIELD_SUBCATEGORY = 'field_subcategory'; // Editable private const HTTP_BAD_REQUEST = 400; private const HTTP_NOT_FOUND = 404; diff --git a/toolbox/backup.sh b/toolbox/backup.sh index c2448e4..863b394 100755 --- a/toolbox/backup.sh +++ b/toolbox/backup.sh @@ -2,7 +2,7 @@ DIR_PATH=${1} DIR=$(/usr/bin/basename ${DIR_PATH}) -LOG="${DIR}.backup.log" +LOG="${DIR}-backup.log" TIMESTAMP=$(/usr/bin/date +%Y/%m/%d' '%H:%M:%S) # @@ -120,8 +120,10 @@ main # Show results # echo -ls -lh ${DIR}-backup.tar.gz --color=auto -ls -lh ${DIR}-backup.md5sum --color=auto +# ls -lh ${DIR}-backup.tar.gz --color=auto +# ls -lh ${DIR}-backup.md5sum --color=auto +# ls -lh ${DIR}-backup.log --color=auto +ls -lh ${DIR}-backup.* --color=auto echo echo -e " MD5 checksum: $(cat ${DIR}-backup.md5sum)" echo diff --git a/toolbox/db.sh b/toolbox/db.sh index 1e562ef..6286d3b 100755 --- a/toolbox/db.sh +++ b/toolbox/db.sh @@ -33,8 +33,8 @@ function usage() { echo -e "${WHT}./db ${BOLDGRN}-cd${GRN} xzy${END} Create database" echo echo -e " 🛟 \e[1mBackup\e[0m" - echo -e "${WHT}./db ${BOLDBLU}-e${BLU} dbname${END} Export database to dbname.sql" - echo -e "${WHT}./db ${BOLDBLU}-i${BLU} dbname dump.sql${END} Import dump.sql into dbname" + echo -e "${WHT}./db ${BOLDBLU}-e${BLU} dbname dump.sql${END} Export database to dump.sql" + echo -e "${WHT}./db ${BOLDBLU}-i${BLU} dbname dump.sql${END} Import dump.sql into database" echo exit } @@ -92,8 +92,8 @@ function create_all() { # BACKUP function export_database() { - mysqldump -u${DBUSER} -p${DBPASS} $1 > $1.sql - ls -l $1.sql + mysqldump -u${DBUSER} -p${DBPASS} $1 > $2 + ls -l $2 } function import_database() { @@ -147,7 +147,7 @@ do exit ;; -e) - export_database $2 + export_database $2 $3 exit ;; -i)