mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-19 08:48:34 +02:00
fix update resource without subdomain
This commit is contained in:
parent
c51f1cb6a2
commit
3fa7132534
2 changed files with 20 additions and 14 deletions
|
@ -175,10 +175,10 @@ export async function updateResource(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let fullDomain = "";
|
let fullDomain: string | undefined;
|
||||||
if (updateData.isBaseDomain) {
|
if (updateData.isBaseDomain) {
|
||||||
fullDomain = org.domain;
|
fullDomain = org.domain;
|
||||||
} else {
|
} else if (updateData.subdomain) {
|
||||||
fullDomain = `${updateData.subdomain}.${org.domain}`;
|
fullDomain = `${updateData.subdomain}.${org.domain}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +187,11 @@ export async function updateResource(
|
||||||
...(fullDomain && { fullDomain })
|
...(fullDomain && { fullDomain })
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (
|
||||||
|
fullDomain &&
|
||||||
|
(updatePayload.subdomain !== undefined ||
|
||||||
|
updatePayload.isBaseDomain !== undefined)
|
||||||
|
) {
|
||||||
const [existingDomain] = await db
|
const [existingDomain] = await db
|
||||||
.select()
|
.select()
|
||||||
.from(resources)
|
.from(resources)
|
||||||
|
@ -200,6 +205,7 @@ export async function updateResource(
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const updatedResource = await db
|
const updatedResource = await db
|
||||||
.update(resources)
|
.update(resources)
|
||||||
|
|
|
@ -42,7 +42,7 @@ export const ResourcesSplashCard = () => {
|
||||||
Resources
|
Resources
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm">
|
<p className="text-sm">
|
||||||
Resources are proxies to applications running on your private network. Create a resource for any HTTP or HTTPS app on your private network.
|
Resources are proxies to applications running on your private network. Create a resource for any HTTP/HTTPS or raw TCP/UDP service on your private network.
|
||||||
Each resource must be connected to a site to enable private, secure connectivity through an encrypted WireGuard tunnel.
|
Each resource must be connected to a site to enable private, secure connectivity through an encrypted WireGuard tunnel.
|
||||||
</p>
|
</p>
|
||||||
<ul className="text-sm text-muted-foreground space-y-2">
|
<ul className="text-sm text-muted-foreground space-y-2">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue