@dnax/core 0.15.4 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/hono.ts +4 -5
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -357,7 +357,7 @@ function HonoInstance(): typeof app {
|
|
|
357
357
|
if (!parseBody?.file) return fn.error("File not found", 404);
|
|
358
358
|
if (col?.slug && col?.media?.enabled) {
|
|
359
359
|
let data = JSON.parse(parseBody?.data) || {};
|
|
360
|
-
rest.startTransaction();
|
|
360
|
+
// rest.startTransaction();
|
|
361
361
|
const drive = new MediaDrive({
|
|
362
362
|
location: col?.media?.overwriteFolderName ?? col?.slug,
|
|
363
363
|
visibility: col?.media?.visibility ?? "public",
|
|
@@ -384,7 +384,7 @@ function HonoInstance(): typeof app {
|
|
|
384
384
|
_file: insertedFile,
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
await rest?.commitTransaction();
|
|
387
|
+
// await rest?.commitTransaction();
|
|
388
388
|
// console.log("File is ", insertedFile);
|
|
389
389
|
} else {
|
|
390
390
|
return fn.error("Media config not set or not enabled", 404);
|
|
@@ -503,9 +503,8 @@ function HonoInstance(): typeof app {
|
|
|
503
503
|
|
|
504
504
|
// Obtenir le type MIME du fichier
|
|
505
505
|
const mimeType = mime.lookup(filePath);
|
|
506
|
-
|
|
507
506
|
// Si ce n'est pas une image, retourner le fichier original
|
|
508
|
-
if (!mimeType || !mimeType
|
|
507
|
+
if (!mimeType || !mimeType?.startsWith("image/")) {
|
|
509
508
|
const originalFile = fs.readFileSync(filePath);
|
|
510
509
|
return c.body(originalFile, 200, {
|
|
511
510
|
"Content-Type": mimeType || "application/octet-stream",
|
|
@@ -518,7 +517,7 @@ function HonoInstance(): typeof app {
|
|
|
518
517
|
.resize(width, height, {
|
|
519
518
|
fit: crop || "contain",
|
|
520
519
|
})
|
|
521
|
-
.
|
|
520
|
+
.png({ quality })
|
|
522
521
|
.toBuffer();
|
|
523
522
|
|
|
524
523
|
// Retourner l'image redimensionnée
|