fix(build): resolve type errors in img.ts and cleanup route.ts
This commit is contained in:
@@ -37,7 +37,7 @@ async function img({
|
||||
.resize(size || metadata.width)
|
||||
.toBuffer();
|
||||
|
||||
return new Response(resized, {
|
||||
return new Response(new Uint8Array(resized), {
|
||||
headers: {
|
||||
"Cache-Control": "public, max-age=3600, stale-while-revalidate=600",
|
||||
"Content-Type": "image/jpeg",
|
||||
@@ -45,7 +45,8 @@ async function img({
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Gagal mengambil file dari MinIO: ${name}`, error);
|
||||
return new Response(await fs.readFile(noImage), {
|
||||
const buffer = await fs.readFile(noImage);
|
||||
return new Response(new Uint8Array(buffer), {
|
||||
headers: { "Content-Type": "image/jpeg" },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import prisma from "@/lib/prisma";
|
||||
import cors, { HTTPMethod } from "@elysiajs/cors";
|
||||
import { staticPlugin } from "@elysiajs/static";
|
||||
import swagger from "@elysiajs/swagger";
|
||||
import { Elysia, t } from "elysia";
|
||||
import fs from "fs/promises";
|
||||
|
||||
Reference in New Issue
Block a user