mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-26 05:35:58 +02:00
Fix domain picker build and copy in for domains
This commit is contained in:
parent
78661799f2
commit
83b00c1cfa
2 changed files with 16 additions and 10 deletions
|
@ -63,7 +63,7 @@ async function copyInDomains() {
|
|||
if (existingDomainKeys.has(domainId)) {
|
||||
await trx
|
||||
.update(domains)
|
||||
.set({ baseDomain })
|
||||
.set({ baseDomain, verified: true, type: "wildcard" })
|
||||
.where(eq(domains.domainId, domainId))
|
||||
.execute();
|
||||
} else {
|
||||
|
|
|
@ -21,6 +21,7 @@ import { AxiosResponse } from "axios";
|
|||
import { cn } from "@/lib/cn";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { build } from "@server/build";
|
||||
|
||||
type OrganizationDomain = {
|
||||
domainId: string;
|
||||
|
@ -95,7 +96,9 @@ export default function DomainPicker({
|
|||
const domains = response.data.data.domains
|
||||
.filter(
|
||||
(domain) =>
|
||||
domain.type === "ns" || domain.type === "cname" || domain.type === "wildcard"
|
||||
domain.type === "ns" ||
|
||||
domain.type === "cname" ||
|
||||
domain.type === "wildcard"
|
||||
)
|
||||
.map((domain) => ({
|
||||
...domain,
|
||||
|
@ -198,7 +201,7 @@ export default function DomainPicker({
|
|||
-(baseDomainLower.length + 1)
|
||||
);
|
||||
// Only allow one level up (no dots in subdomain)
|
||||
if (!subdomain.includes('.')) {
|
||||
if (!subdomain.includes(".")) {
|
||||
options.push({
|
||||
id: `org-${orgDomain.domainId}`,
|
||||
domain: userInput,
|
||||
|
@ -220,7 +223,7 @@ export default function DomainPicker({
|
|||
domain: option.fullDomain,
|
||||
type: "provided",
|
||||
domainNamespaceId: option.domainNamespaceId,
|
||||
domainId: option.domainId,
|
||||
domainId: option.domainId
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -278,7 +281,7 @@ export default function DomainPicker({
|
|||
subdomain: option.subdomain || undefined,
|
||||
fullDomain: option.domain,
|
||||
baseDomain: option.subdomain
|
||||
? option.domain.split('.').slice(1).join('.')
|
||||
? option.domain.split(".").slice(1).join(".")
|
||||
: option.domain
|
||||
});
|
||||
}
|
||||
|
@ -339,9 +342,11 @@ export default function DomainPicker({
|
|||
<TabsTrigger value="organization">
|
||||
{t("domainPickerTabOrganization")}
|
||||
</TabsTrigger>
|
||||
{build == "saas" && (
|
||||
<TabsTrigger value="provided">
|
||||
{t("domainPickerTabProvided")}
|
||||
</TabsTrigger>
|
||||
)}
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
<Button
|
||||
|
@ -406,7 +411,8 @@ export default function DomainPicker({
|
|||
: "cursor-not-allowed opacity-60"
|
||||
)}
|
||||
onClick={() =>
|
||||
option.verified && handleOptionSelect(option)
|
||||
option.verified &&
|
||||
handleOptionSelect(option)
|
||||
}
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue