Skip to content

Commit

Permalink
JNG-5962 aggregation validation
Browse files Browse the repository at this point in the history
  • Loading branch information
noherczeg committed Oct 14, 2024
1 parent 9884c1e commit a73122e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ export default function ActorInlineEditTransferAccessViewPage() {
};
const applyManyAggregationCompositionRowEdit = async (rowData: TransferObjectHStored): Promise<any> => {
try {
await actorServiceForInlineEditTransferImpl.validateUpdateManyAggregationComposition(
{ __signedIdentifier: signedIdentifier } as any,
rowData,
);
if (rowData.__identifier!.startsWith(draftIdentifierPrefix)) {
const updatedList = [rowData, ...(data.manyAggregationComposition || [])];
storeDiff('manyAggregationComposition', updatedList);
Expand All @@ -601,6 +605,10 @@ export default function ActorInlineEditTransferAccessViewPage() {
};
const applyManyDerivedAggregationAssociationRowEdit = async (rowData: TransferObjectHStored): Promise<any> => {
try {
await actorServiceForInlineEditTransferImpl.validateUpdateManyDerivedAggregationAssociation(
{ __signedIdentifier: signedIdentifier } as any,
rowData,
);
if (rowData.__identifier!.startsWith(draftIdentifierPrefix)) {
const updatedList = [rowData, ...(data.manyDerivedAggregationAssociation || [])];
storeDiff('manyDerivedAggregationAssociation', updatedList);
Expand All @@ -619,6 +627,10 @@ export default function ActorInlineEditTransferAccessViewPage() {
};
const applyManyDerivedAggregationCompositionRowEdit = async (rowData: TransferObjectHStored): Promise<any> => {
try {
await actorServiceForInlineEditTransferImpl.validateUpdateManyDerivedAggregationComposition(
{ __signedIdentifier: signedIdentifier } as any,
rowData,
);
if (rowData.__identifier!.startsWith(draftIdentifierPrefix)) {
const updatedList = [rowData, ...(data.manyDerivedAggregationComposition || [])];
storeDiff('manyDerivedAggregationComposition', updatedList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export default function {{ pageName page }}() {
const apply{{ firstToUpper table.relationName }}RowEdit = async (rowData: {{ classDataName (getReferenceClassType table) 'Stored' }}): Promise<any> => {
try {
{{# if table.isEager }}
await {{ getServiceImplForPage page }}.validateUpdate{{ firstToUpper table.relationName }}(
{ __signedIdentifier: signedIdentifier } as any,
rowData,
);
if (rowData.__identifier!.startsWith(draftIdentifierPrefix)) {
const updatedList = [rowData, ...(data.{{ table.relationName }} || [])];
storeDiff('{{ table.dataElement.name }}', updatedList);
Expand Down

0 comments on commit a73122e

Please sign in to comment.