|
|
@@ -152,28 +152,10 @@ class HydraNormalizer {
|
|
|
return HydraNormalizer.denormalizeEnum(item)
|
|
|
}
|
|
|
|
|
|
- let entity = null
|
|
|
-
|
|
|
- // On essaie de déterminer la nature de l'objet à partir de son id
|
|
|
- try {
|
|
|
- const iri = HydraNormalizer.parseEntityIRI(itemId)
|
|
|
- entity = iri.entity
|
|
|
- } catch {
|
|
|
- console.error('De-normalization error : could not parse the IRI', item)
|
|
|
- return item
|
|
|
- }
|
|
|
-
|
|
|
- if (
|
|
|
- entity &&
|
|
|
- Object.prototype.hasOwnProperty.call(HydraNormalizer.models, entity)
|
|
|
- ) {
|
|
|
- model = HydraNormalizer.models[entity]
|
|
|
- return HydraNormalizer.denormalizeEntity(model, item)
|
|
|
- }
|
|
|
+ console.error('De-normalization error : unknown item type', item)
|
|
|
|
|
|
throw new Error(
|
|
|
- 'De-normalization error : Could not determine the type of the entity ' +
|
|
|
- itemId + ' (found: ' + entity + ')',
|
|
|
+ 'De-normalization error : Could not determine the type of the entity'
|
|
|
)
|
|
|
}
|
|
|
|