🔧 Refactoring uncompression methods.

This commit is contained in:
2022-12-02 10:30:34 -08:00
parent 9393c02b53
commit 5f3c93da73
4 changed files with 83 additions and 53 deletions

View File

@@ -56,12 +56,12 @@ export default class ApiService extends Service {
{
path: "/userdata",
use: [
ApiGateway.serveStatic(path.resolve("/userdata")),
ApiGateway.serveStatic(path.resolve("./userdata")),
],
},
{
path: "/comics",
use: [ApiGateway.serveStatic(path.resolve("/comics"))],
use: [ApiGateway.serveStatic(path.resolve("./comics"))],
},
{
path: "/logs",

View File

@@ -95,9 +95,12 @@ export default class ImportService extends Service {
uncompressFullArchive: {
rest: "POST /uncompressFullArchive",
params: {},
handler: async (ctx: Context<{ filePath: string }>) => {
handler: async (
ctx: Context<{ filePath: string; options: any }>
) => {
return await uncompressEntireArchive(
ctx.params.filePath
ctx.params.filePath,
ctx.params.options
);
},
},
@@ -302,17 +305,17 @@ export default class ImportService extends Service {
async handler(
ctx: Context<{
bundleId: String;
comicObjectId: String,
comicObjectId: String;
name: String;
size: Number;
type: String;
}>
) {
console.log(JSON.stringify(ctx.params, null, 2))
console.log(JSON.stringify(ctx.params, null, 2));
const comicObjectId = new ObjectId(
ctx.params.comicObjectId
);
return new Promise((resolve, reject) => {
Comic.findByIdAndUpdate(
comicObjectId,
@@ -322,7 +325,7 @@ export default class ImportService extends Service {
bundleId: ctx.params.bundleId,
name: ctx.params.name,
size: ctx.params.size,
type: ctx.params.type,
type: ctx.params.type,
},
},
},