From 4a3030596f1025b5e139409a6c91a38dfe1c8466 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 24 Dec 2023 08:18:30 -0500 Subject: [PATCH] refactor: rename siteKey column to site --- app/components/Feed.tsx | 3 +-- app/routes/api.events.siteUpdateReceived.ts | 2 +- app/routes/api.search.ts | 2 +- app/utils.ts | 2 +- prisma/schema.prisma | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/components/Feed.tsx b/app/components/Feed.tsx index cd4157b..1b1a463 100644 --- a/app/components/Feed.tsx +++ b/app/components/Feed.tsx @@ -64,10 +64,9 @@ const Feed = ({ updatedAt: new Date(), title: "Loading", id: 0, - slug: "loading", cid: "", url: "", - siteKey: "", + site: "", }, ]; } diff --git a/app/routes/api.events.siteUpdateReceived.ts b/app/routes/api.events.siteUpdateReceived.ts index bd9ff62..ec5e9b0 100644 --- a/app/routes/api.events.siteUpdateReceived.ts +++ b/app/routes/api.events.siteUpdateReceived.ts @@ -84,7 +84,7 @@ export async function action({ request }: ActionFunctionArgs) { createdAt: new Date(), updatedAt: new Date(), slug: slugify(new URL(url).pathname), - siteKey: data.site, + site: data.site, }; // Insert a new record into the database diff --git a/app/routes/api.search.ts b/app/routes/api.search.ts index 2f6f567..45ba250 100644 --- a/app/routes/api.search.ts +++ b/app/routes/api.search.ts @@ -18,7 +18,7 @@ export async function loader({ request }: LoaderFunctionArgs) { let filters = []; if (site) { - filters.push(`siteKey = ${site}`); + filters.push(`site = ${site}`); } if (time) { filters.push(`createdTimestamp >= ${parseInt(time).toString()}`); diff --git a/app/utils.ts b/app/utils.ts index 853a6f0..8652ef0 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -37,7 +37,7 @@ export async function getResults({ let filters = []; if (site) { - filters.push(`siteKey = ${site}`); + filters.push(`site = ${site}`); } if (time) { filters.push(`createdTimestamp >= ${parseInt(time).toString()}`); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index bc64dad..af66e7c 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -16,5 +16,5 @@ model Article { url String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - siteKey String + site String }