Skip to content
Snippets Groups Projects
Commit 1a86e58a authored by Nicolas.Rod's avatar Nicolas.Rod
Browse files

feat(AouRelation2TiersController): create with default relation properties if none are given

parent b7548b93
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,10 @@ public abstract class AouRelation2TiersController<T extends Resource<T>, V exten
final T parentItem = this.itemService.findOne(parentid);
final V childItem = this.childItemService.findOne(id);
if (joinItem == null) {
joinItem = this.relationItemService.getDefaultJoinResource();
}
if (!this.relationItemService.relationExists(parentItem, childItem)) {
D childDTO = this.relationItemService.saveRelation(parentItem, childItem, joinItem);
this.addLinks(parentid, childDTO);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment