fix base domain overwritten on update closes #282

This commit is contained in:
miloschwartz 2025-03-09 21:09:56 -04:00
parent 8ec55eb70d
commit ad32e5e651
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -215,8 +215,13 @@ async function updateHttpResource(
.from(domains)
.where(eq(domains.domainId, domainId));
const isBaseDomain =
updateData.isBaseDomain !== undefined
? updateData.isBaseDomain
: resource.isBaseDomain;
let fullDomain: string | null = null;
if (updateData.isBaseDomain) {
if (isBaseDomain) {
fullDomain = domain.baseDomain;
} else if (subdomain && domain) {
fullDomain = `${subdomain}.${domain.baseDomain}`;