@@ -259,7 +259,7 @@ export function createAuthorityEntity(
259259 ...customAuthorityData ,
260260 } ;
261261
262- loadRequiredConfigIntoEntity ( authorityEntity , application as BaseApplicationApplication < BaseApplicationEntity > ) ;
262+ loadRequiredConfigIntoEntity ( authorityEntity , application ) ;
263263 // Fallback to defaults for test cases.
264264 loadRequiredConfigIntoEntity ( authorityEntity , this . jhipsterConfigWithDefaults as BaseApplicationApplication < BaseApplicationEntity > ) ;
265265
@@ -281,15 +281,15 @@ function addOrExtendFields<const F extends BaseApplicationField>(fields: F[], fi
281281 for ( const fieldToAdd of fieldsToAdd ) {
282282 const { fieldName : newFieldName , id } = fieldToAdd ;
283283 let field = fields . find ( field => field . fieldName === newFieldName ) ;
284- if ( ! field ) {
284+ if ( field ) {
285+ defaults ( field , fieldToAdd ) ;
286+ } else {
285287 field = { ...fieldToAdd } ;
286288 if ( id ) {
287289 fields . unshift ( field ) ;
288290 } else {
289291 fields . push ( field ) ;
290292 }
291- } else {
292- defaults ( field , fieldToAdd ) ;
293293 }
294294 }
295295}
@@ -298,11 +298,11 @@ function addOrExtendRelationships<const R extends BaseApplicationRelationship>(r
298298 for ( const relationshipToAdd of relationshipsToAdd ) {
299299 const { relationshipName : newrelationshipName } = relationshipToAdd ;
300300 let relationship = relationships . find ( relationship => relationship . relationshipName === newrelationshipName ) ;
301- if ( ! relationship ) {
301+ if ( relationship ) {
302+ defaults ( relationship , relationshipToAdd ) ;
303+ } else {
302304 relationship = { ...relationshipToAdd } ;
303305 relationships . push ( relationship ) ;
304- } else {
305- defaults ( relationship , relationshipToAdd ) ;
306306 }
307307 }
308308}
0 commit comments