add taxonomy field

This commit is contained in:
Ste Vaidis 2024-04-12 17:07:04 +03:00
parent 61911396ea
commit 5bc4992a61
5 changed files with 20 additions and 2 deletions

View File

@ -34,7 +34,7 @@ echo -e " 🍓 Found module ${B}endpoint_get_${NODE}${E}"
../vendor/drush/drush/drush pml --fields=name,status > /tmp/.drush.pml
cat /tmp/.drush.pml | grep -e "Enabled" | grep "endpoint_get_${NODE}"
if [ $? -eq 0 ];then
echo -n "\n 🍓 Disabling module ${B}endpoint_get_${NODE}${E}"
echo -en "\n 🍓 Disabling module ${B}endpoint_get_${NODE}${E}"
../vendor/drush/drush/drush pmu "endpoint_get_${NODE}"
fi

View File

@ -102,7 +102,7 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
$this->response = [
'code' => $this->statusCode,
'alias' => '/AAAAA/'.$alias,
'nid' => $nid,
'nid' => intval($nid),
'author' => $name,
'title' => $node->get('title')->value,
// AUTO_ADD_CODE_BELLOW_response

View File

@ -0,0 +1,16 @@
$category_id = (
$node
->get(self::FIELD_CATEGORY)
->entity) ? intval(\\Drupal::service('entity.repository')
->getTranslationFromContext(
$node->get(self::FIELD_CATEGORY)->entity,
$node->currentTranslation
)->id()) : null;
$category_label = (
$node
->get(self::FIELD_CATEGORY)
->entity) ? \\Drupal::service('entity.repository')
->getTranslationFromContext(
$node->get(self::FIELD_CATEGORY)->entity,
$node->currentTranslation
)->getName() : null;

View File

@ -0,0 +1,2 @@
'category_id' => $category_id,
'category_label' => $category_label,