refactor: we no longer need to deal with slugs

This commit is contained in:
Derrick Hammer 2023-12-24 08:20:09 -05:00
parent e1ba8a7656
commit 9a1a2dfecf
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 1 additions and 14 deletions

View File

@ -16,7 +16,6 @@ import {
} from "@/components/ui/popover"; } from "@/components/ui/popover";
import { ChevronDownIcon } from "@heroicons/react/24/solid"; import { ChevronDownIcon } from "@heroicons/react/24/solid";
import { SelectOptions, SiteList } from "@/types.js"; import { SelectOptions, SiteList } from "@/types.js";
import slugify from "slugify";
import { useEffect } from "react"; import { useEffect } from "react";
export function SitesCombobox({ export function SitesCombobox({
@ -29,7 +28,7 @@ export function SitesCombobox({
const sites = Object.entries(siteList).map((item) => { const sites = Object.entries(siteList).map((item) => {
return { return {
label: item[1].name, label: item[1].name,
value: slugify(item[0]), value: item[0],
}; };
}); });
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);

View File

@ -7,7 +7,6 @@ import {
import { S5Client } from "@lumeweb/s5-js"; import { S5Client } from "@lumeweb/s5-js";
import xml2js from "xml2js"; import xml2js from "xml2js";
import { prisma } from "@/lib/prisma"; import { prisma } from "@/lib/prisma";
import slugify from "slugify";
import path from "path"; import path from "path";
import { getAvailableSites } from "@/utils.js"; import { getAvailableSites } from "@/utils.js";
import { CID } from "@lumeweb/libs5"; import { CID } from "@lumeweb/libs5";
@ -83,7 +82,6 @@ export async function action({ request }: ActionFunctionArgs) {
cid: CID.decode(cid).toString(), cid: CID.decode(cid).toString(),
createdAt: new Date(), createdAt: new Date(),
updatedAt: new Date(), updatedAt: new Date(),
slug: slugify(new URL(url).pathname),
site: data.site, site: data.site,
}; };

9
package-lock.json generated
View File

@ -29,7 +29,6 @@
"meilisearch": "^0.36.0", "meilisearch": "^0.36.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"slugify": "^1.6.6",
"swr": "^2.2.4", "swr": "^2.2.4",
"tailwind-merge": "^2.0.0", "tailwind-merge": "^2.0.0",
"xml2js": "^0.6.2" "xml2js": "^0.6.2"
@ -11452,14 +11451,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/slugify": {
"version": "1.6.6",
"resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz",
"integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==",
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/source-map": { "node_modules/source-map": {
"version": "0.7.4", "version": "0.7.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",

View File

@ -40,7 +40,6 @@
"meilisearch": "^0.36.0", "meilisearch": "^0.36.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"slugify": "^1.6.6",
"swr": "^2.2.4", "swr": "^2.2.4",
"tailwind-merge": "^2.0.0", "tailwind-merge": "^2.0.0",
"xml2js": "^0.6.2" "xml2js": "^0.6.2"