refactor: rename siteKey column to site

This commit is contained in:
Derrick Hammer 2023-12-24 08:18:30 -05:00
parent 232df2b60a
commit 4a3030596f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
5 changed files with 5 additions and 6 deletions

View File

@ -64,10 +64,9 @@ const Feed = ({
updatedAt: new Date(), updatedAt: new Date(),
title: "Loading", title: "Loading",
id: 0, id: 0,
slug: "loading",
cid: "", cid: "",
url: "", url: "",
siteKey: "", site: "",
}, },
]; ];
} }

View File

@ -84,7 +84,7 @@ export async function action({ request }: ActionFunctionArgs) {
createdAt: new Date(), createdAt: new Date(),
updatedAt: new Date(), updatedAt: new Date(),
slug: slugify(new URL(url).pathname), slug: slugify(new URL(url).pathname),
siteKey: data.site, site: data.site,
}; };
// Insert a new record into the database // Insert a new record into the database

View File

@ -18,7 +18,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
let filters = []; let filters = [];
if (site) { if (site) {
filters.push(`siteKey = ${site}`); filters.push(`site = ${site}`);
} }
if (time) { if (time) {
filters.push(`createdTimestamp >= ${parseInt(time).toString()}`); filters.push(`createdTimestamp >= ${parseInt(time).toString()}`);

View File

@ -37,7 +37,7 @@ export async function getResults({
let filters = []; let filters = [];
if (site) { if (site) {
filters.push(`siteKey = ${site}`); filters.push(`site = ${site}`);
} }
if (time) { if (time) {
filters.push(`createdTimestamp >= ${parseInt(time).toString()}`); filters.push(`createdTimestamp >= ${parseInt(time).toString()}`);

View File

@ -16,5 +16,5 @@ model Article {
url String url String
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
siteKey String site String
} }