You are here

function jsonapi_entity_create in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/jsonapi.module \jsonapi_entity_create()
  2. 9 core/modules/jsonapi/jsonapi.module \jsonapi_entity_create()

Implements hook_entity_create().

File

core/modules/jsonapi/jsonapi.module, line 145
Module implementation file.

Code

function jsonapi_entity_create(EntityInterface $entity) {
  if (in_array($entity
    ->getEntityTypeId(), [
    'field_storage_config',
    'field_config',
  ])) {

    // @todo: only do this when relationship fields are updated, not just any field.
    JsonApiRoutes::rebuild();
  }
}