feat: add delete button in history (#440)
This commit is contained in:
parent
0096a6f197
commit
64264a41d9
8 changed files with 122 additions and 104 deletions
|
|
@ -12,6 +12,7 @@ export const download = new Elysia()
|
|||
.get(
|
||||
"/download/:userId/:jobId/:fileName",
|
||||
async ({ params, redirect, user }) => {
|
||||
const userId = user.id;
|
||||
const job = await db
|
||||
.query("SELECT * FROM jobs WHERE user_id = ? AND id = ?")
|
||||
.get(user.id, params.jobId);
|
||||
|
|
@ -20,7 +21,6 @@ export const download = new Elysia()
|
|||
return redirect(`${WEBROOT}/results`, 302);
|
||||
}
|
||||
// parse from URL encoded string
|
||||
const userId = decodeURIComponent(params.userId);
|
||||
const jobId = decodeURIComponent(params.jobId);
|
||||
const fileName = sanitize(decodeURIComponent(params.fileName));
|
||||
|
||||
|
|
@ -32,8 +32,9 @@ export const download = new Elysia()
|
|||
},
|
||||
)
|
||||
.get(
|
||||
"/archive/:userId/:jobId",
|
||||
"/archive/:jobId",
|
||||
async ({ params, redirect, user }) => {
|
||||
const userId = user.id;
|
||||
const job = await db
|
||||
.query("SELECT * FROM jobs WHERE user_id = ? AND id = ?")
|
||||
.get(user.id, params.jobId);
|
||||
|
|
@ -42,7 +43,6 @@ export const download = new Elysia()
|
|||
return redirect(`${WEBROOT}/results`, 302);
|
||||
}
|
||||
|
||||
const userId = decodeURIComponent(params.userId);
|
||||
const jobId = decodeURIComponent(params.jobId);
|
||||
const outputPath = `${outputDir}${userId}/${jobId}`;
|
||||
const outputTar = path.join(outputPath, `converted_files_${jobId}.tar`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue