You are here

function jsonapi_entity_create in JSON:API 8.2

Implements hook_entity_create().

File

./jsonapi.module, line 161
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();
  }
}