Skip to content

Commit 9120e1d

Browse files
committed
remove barrel imports
1 parent 2c5a49a commit 9120e1d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

apps/web/lib/api/links/bulk-create-links.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ import { includeProgramEnrollment } from "./include-program-enrollment";
1010
import { includeTags } from "./include-tags";
1111
import { propagateBulkLinkChanges } from "./propagate-bulk-link-changes";
1212
import { updateLinksUsage } from "./update-links-usage";
13-
import {
14-
checkIfLinksHaveTags,
15-
checkIfLinksHaveWebhooks,
16-
transformLink,
17-
} from "./utils";
13+
import { checkIfLinksHaveTags } from "./utils/check-if-links-have-tags";
14+
import { checkIfLinksHaveWebhooks } from "./utils/check-if-links-have-webhooks";
15+
import { transformLink } from "./utils/transform-link";
1816

1917
export async function bulkCreateLinks({
2018
links,

apps/web/scripts/sitemap-importer.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createId } from "@/lib/api/create-id";
22
import { prisma } from "@dub/prisma";
33
import "dotenv-flow/config";
44
import { XMLParser } from "fast-xml-parser";
5-
import { bulkCreateLinks } from "../lib/api/links";
5+
import { bulkCreateLinks } from "../lib/api/links/bulk-create-links";
66

77
async function fetchSitemap(url: string) {
88
const response = await fetch(url);
@@ -14,19 +14,21 @@ async function fetchSitemap(url: string) {
1414

1515
const sitemapUrl = "https://dub.co/sitemap.xml";
1616
const domain = "site.dub.co";
17-
const projectId = "xxx";
18-
const userId = "xxx";
19-
const folderId = "xxx";
17+
const projectId = "ws_xxx";
18+
const userId = "user_xxx";
19+
const folderId = "fold_xxx";
2020

2121
async function main() {
2222
// Fetch and parse sitemap
2323
const sitemapUrls = await fetchSitemap(sitemapUrl);
2424

25-
// Filter out homepage and invalid URLs
2625
const validUrls = sitemapUrls
26+
// filter out other sitemaps
27+
.filter((url: string) => !url.endsWith("sitemap.xml"))
2728
.map((url: string) => {
2829
const urlObj = new URL(url);
2930
let key = urlObj.pathname.slice(1);
31+
// convert homepage to _root
3032
if (key === "") {
3133
key = "_root";
3234
}

0 commit comments

Comments
 (0)