rename db.fileName -> db,file

This commit is contained in:
Rdeisenroth 2025-11-06 23:27:35 +01:00
parent ae2cd5e61f
commit 132622d728
No known key found for this signature in database
GPG key ID: 197008FA42DE7127
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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,

View file

@ -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,
},