order props so they fit what came in (#17585)

This commit is contained in:
Niels Lyngsø
2024-11-20 09:16:17 +01:00
committed by GitHub
parent b7713f9386
commit 69e8a61cdd
2 changed files with 7 additions and 9 deletions

View File

@@ -32,14 +32,12 @@ export class UmbMergeContentVariantDataController extends UmbControllerBase {
// Combine data and persisted data depending on the selectedVariants. Always use the invariant values from the data.
// loops over each entry in values, determine wether the value should be from the data or the persisted data, depending on wether its a selectedVariant or an invariant value.
// loops over each entry in variants, determine wether the variant should be from the data or the persisted data, depending on the selectedVariants.
const result = {
...currentData,
values: await this.#processValues<ModelType['values'][0]>(
persistedData?.values,
currentData.values,
variantsToStore,
),
};
const result = { ...currentData };
result.values = await this.#processValues<ModelType['values'][0]>(
persistedData?.values,
currentData.values,
variantsToStore,
);
if (currentData.variants) {
// Notice for variants we do not want to include all the variants that we are processing. but just the once selected for the process. (Not include invariant if we are in a variant document) [NL]

View File

@@ -102,9 +102,9 @@ export class UmbDocumentServerDataSource implements UmbDetailDataSource<UmbDocum
}),
variants: data.variants.map((variant) => {
return {
state: variant.state,
culture: variant.culture || null,
segment: variant.segment || null,
state: variant.state,
name: variant.name,
publishDate: variant.publishDate || null,
createDate: variant.createDate,