From 132622d7281d2cda087dcce6a4fccf84c0d8c40e Mon Sep 17 00:00:00 2001 From: Rdeisenroth Date: Thu, 6 Nov 2025 23:27:35 +0100 Subject: [PATCH] rename db.fileName -> db,file --- prisma/schema.prisma | 4 ++-- src/converters/main.ts | 2 +- src/pages/results.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b9b7aa5..606a398 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -37,7 +37,7 @@ model Job { /// The number of files associated with the job numFiles Int @default(0) @map("num_files") /// The files associated with the job - files FileName[] + files File[] /// The user who created the job user User @relation(fields: [userId], references: [id]) @@ -46,7 +46,7 @@ model Job { } /// A file associated with a job -model FileName { +model File { /// The unique identifier for the file id Int @id @default(autoincrement()) /// The ID of the job this file belongs to diff --git a/src/converters/main.ts b/src/converters/main.ts index 5885b2f..4876c1e 100644 --- a/src/converters/main.ts +++ b/src/converters/main.ts @@ -163,7 +163,7 @@ export async function handleConvert( mainConverter(filePath, fileType, convertTo, targetPath, {}, converterName) .then(async (r) => { if (jobId.value) { - await prisma.fileName.create({ + await prisma.file.create({ data: { jobId: parseInt(jobId.value, 10), fileName, diff --git a/src/pages/results.tsx b/src/pages/results.tsx index 2137e1b..917e69b 100644 --- a/src/pages/results.tsx +++ b/src/pages/results.tsx @@ -3,7 +3,7 @@ import { Elysia } from "elysia"; import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import db from "../db/db"; -import { Job, FileName } from "@prisma/client"; +import { Job, File } from "@prisma/client"; import { ALLOW_UNAUTHENTICATED, WEBROOT } from "../helpers/env"; import { DownloadIcon } from "../icons/download"; import { DeleteIcon } from "../icons/delete"; @@ -20,7 +20,7 @@ function ResultsArticle({ id: string; } & JWTPayloadSpec; job: Job; - files: FileName[]; + files: File[]; outputPath: string; }) { return ( @@ -162,7 +162,7 @@ export const results = new Elysia() const outputPath = `${userId}/${jobId}/`; - const files = await db.fileName.findMany({ + const files = await db.file.findMany({ where: { jobId, }, @@ -214,7 +214,7 @@ export const results = new Elysia() const outputPath = `${userId}/${jobId}/`; - const files = await db.fileName.findMany({ + const files = await db.file.findMany({ where: { jobId, },