Skip to content

Commit 20be819

Browse files
committed
Fix tests
1 parent 54ce8cb commit 20be819

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

packages/stack-shared/src/config/schema.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ function deepReplaceFunctionsWithObjects(obj: any, paths: string[] = []): any {
650650
};
651651
const currentPaths = [...new Set(paths.map(p => p.split(".")[0]))];
652652
const nonDeepReplaced = {
653-
...obj,
654653
...typeof obj === "function" ? filterUndefined(Object.fromEntries(currentPaths.map(k => [k, obj(k)]))) : {},
654+
...obj,
655655
};
656656
return mapValues(nonDeepReplaced, (v, k) => (isObjectLike(v) ? deepReplaceFunctionsWithObjects(v as any, subPaths(k as string)) : v));
657657
}
@@ -812,14 +812,6 @@ export async function sanitizeEnvironmentConfig<T extends EnvironmentRenderedCon
812812
export async function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBeforeSanitization) {
813813
assertNormalized(config);
814814
const prepared = await sanitizeEnvironmentConfig(config);
815-
const themes: typeof prepared.emails.themes = {
816-
...DEFAULT_EMAIL_THEMES,
817-
...prepared.emails.themes,
818-
};
819-
const templates: typeof prepared.emails.templates = {
820-
...DEFAULT_EMAIL_TEMPLATES,
821-
...(config.emails.server.isShared ? {} : prepared.emails.templates),
822-
};
823815
const products = typedFromEntries(typedEntries(prepared.payments.products).map(([key, product]) => {
824816
const isAddOnTo = product.isAddOnTo === false ?
825817
false as const :
@@ -843,9 +835,7 @@ export async function sanitizeOrganizationConfig(config: OrganizationRenderedCon
843835
...prepared,
844836
emails: {
845837
...prepared.emails,
846-
selectedThemeId: has(themes, prepared.emails.selectedThemeId) ? prepared.emails.selectedThemeId : DEFAULT_EMAIL_THEME_ID,
847-
themes,
848-
templates,
838+
selectedThemeId: has(prepared.emails.themes, prepared.emails.selectedThemeId) ? prepared.emails.selectedThemeId : DEFAULT_EMAIL_THEME_ID,
849839
},
850840
payments: {
851841
...prepared.payments,

0 commit comments

Comments
 (0)