rename db.fileName -> db,file
This commit is contained in:
parent
ae2cd5e61f
commit
132622d728
3 changed files with 7 additions and 7 deletions
|
|
@ -37,7 +37,7 @@ model Job {
|
||||||
/// The number of files associated with the job
|
/// The number of files associated with the job
|
||||||
numFiles Int @default(0) @map("num_files")
|
numFiles Int @default(0) @map("num_files")
|
||||||
/// The files associated with the job
|
/// The files associated with the job
|
||||||
files FileName[]
|
files File[]
|
||||||
|
|
||||||
/// The user who created the job
|
/// The user who created the job
|
||||||
user User @relation(fields: [userId], references: [id])
|
user User @relation(fields: [userId], references: [id])
|
||||||
|
|
@ -46,7 +46,7 @@ model Job {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A file associated with a job
|
/// A file associated with a job
|
||||||
model FileName {
|
model File {
|
||||||
/// The unique identifier for the file
|
/// The unique identifier for the file
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
/// The ID of the job this file belongs to
|
/// The ID of the job this file belongs to
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ export async function handleConvert(
|
||||||
mainConverter(filePath, fileType, convertTo, targetPath, {}, converterName)
|
mainConverter(filePath, fileType, convertTo, targetPath, {}, converterName)
|
||||||
.then(async (r) => {
|
.then(async (r) => {
|
||||||
if (jobId.value) {
|
if (jobId.value) {
|
||||||
await prisma.fileName.create({
|
await prisma.file.create({
|
||||||
data: {
|
data: {
|
||||||
jobId: parseInt(jobId.value, 10),
|
jobId: parseInt(jobId.value, 10),
|
||||||
fileName,
|
fileName,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Elysia } from "elysia";
|
||||||
import { BaseHtml } from "../components/base";
|
import { BaseHtml } from "../components/base";
|
||||||
import { Header } from "../components/header";
|
import { Header } from "../components/header";
|
||||||
import db from "../db/db";
|
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 { ALLOW_UNAUTHENTICATED, WEBROOT } from "../helpers/env";
|
||||||
import { DownloadIcon } from "../icons/download";
|
import { DownloadIcon } from "../icons/download";
|
||||||
import { DeleteIcon } from "../icons/delete";
|
import { DeleteIcon } from "../icons/delete";
|
||||||
|
|
@ -20,7 +20,7 @@ function ResultsArticle({
|
||||||
id: string;
|
id: string;
|
||||||
} & JWTPayloadSpec;
|
} & JWTPayloadSpec;
|
||||||
job: Job;
|
job: Job;
|
||||||
files: FileName[];
|
files: File[];
|
||||||
outputPath: string;
|
outputPath: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -162,7 +162,7 @@ export const results = new Elysia()
|
||||||
|
|
||||||
const outputPath = `${userId}/${jobId}/`;
|
const outputPath = `${userId}/${jobId}/`;
|
||||||
|
|
||||||
const files = await db.fileName.findMany({
|
const files = await db.file.findMany({
|
||||||
where: {
|
where: {
|
||||||
jobId,
|
jobId,
|
||||||
},
|
},
|
||||||
|
|
@ -214,7 +214,7 @@ export const results = new Elysia()
|
||||||
|
|
||||||
const outputPath = `${userId}/${jobId}/`;
|
const outputPath = `${userId}/${jobId}/`;
|
||||||
|
|
||||||
const files = await db.fileName.findMany({
|
const files = await db.file.findMany({
|
||||||
where: {
|
where: {
|
||||||
jobId,
|
jobId,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue