Skip to content

Commit

Permalink
moved primary key field processing to bootstrap-app instead of bootst…
Browse files Browse the repository at this point in the history
…rap-app-base
  • Loading branch information
Tcharl committed Jan 8, 2025
1 parent f14ed9d commit f16e838
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions generators/bootstrap-application/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ export default class BootstrapApplicationGenerator extends BaseApplicationGenera
get postPreparingEachEntity() {
return this.asPostPreparingEachEntityTaskGroup({
processEntityPrimaryKeysDerivedProperties({ entity }) {
const primaryKey = entity.primaryKey;
if (!primaryKey || primaryKey.composite || !primaryKey.derived) {
return;
}
const derivedFields = primaryKey.derivedFields;
entity.fields.unshift(...derivedFields);

if (!entity.primaryKey) return;
derivedPrimaryKeyProperties(entity.primaryKey);
},
Expand All @@ -173,14 +180,6 @@ export default class BootstrapApplicationGenerator extends BaseApplicationGenera
preparePostEntityServerDerivedProperties(entity);
}
},
processDerivedPrimaryKeyFields({ entity }) {
const primaryKey = entity.primaryKey;
if (!primaryKey || primaryKey.composite || !primaryKey.derived) {
return;
}
const derivedFields = primaryKey.derivedFields;
entity.fields.unshift(...derivedFields);
},
});
}

Expand Down

0 comments on commit f16e838

Please sign in to comment.