mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-12 05:36:38 +00:00
fix update resource without subdomain
This commit is contained in:
@@ -175,10 +175,10 @@ export async function updateResource(
|
||||
);
|
||||
}
|
||||
|
||||
let fullDomain = "";
|
||||
let fullDomain: string | undefined;
|
||||
if (updateData.isBaseDomain) {
|
||||
fullDomain = org.domain;
|
||||
} else {
|
||||
} else if (updateData.subdomain) {
|
||||
fullDomain = `${updateData.subdomain}.${org.domain}`;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,11 @@ export async function updateResource(
|
||||
...(fullDomain && { fullDomain })
|
||||
};
|
||||
|
||||
if (
|
||||
fullDomain &&
|
||||
(updatePayload.subdomain !== undefined ||
|
||||
updatePayload.isBaseDomain !== undefined)
|
||||
) {
|
||||
const [existingDomain] = await db
|
||||
.select()
|
||||
.from(resources)
|
||||
@@ -200,6 +205,7 @@ export async function updateResource(
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const updatedResource = await db
|
||||
.update(resources)
|
||||
|
||||
@@ -42,7 +42,7 @@ export const ResourcesSplashCard = () => {
|
||||
Resources
|
||||
</h3>
|
||||
<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.
|
||||
</p>
|
||||
<ul className="text-sm text-muted-foreground space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user