fix build for liara
This commit is contained in:
Generated
-10515
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import sharp from "sharp";
|
||||
|
||||
@@ -6,10 +7,12 @@ export const revalidate = 0;
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ name: string }> }
|
||||
{ params }: { params: Promise<{ name: string }> },
|
||||
) {
|
||||
try {
|
||||
const { name } = await params;
|
||||
console.log("name", name);
|
||||
|
||||
const searchParams = request.nextUrl.searchParams;
|
||||
const logoUrl = searchParams.get("url");
|
||||
const size = parseInt(searchParams.get("size") || "192");
|
||||
@@ -40,8 +43,9 @@ export async function GET(
|
||||
fit: "contain",
|
||||
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
||||
});
|
||||
const outputBuffer = await processedImage.png().toBuffer();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const outputBuffer: any = await processedImage.png().toBuffer();
|
||||
|
||||
return new NextResponse(outputBuffer, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
@@ -76,13 +80,12 @@ export async function GET(
|
||||
});
|
||||
|
||||
// تبدیل به PNG و برگرداندن
|
||||
const outputBuffer = await processedImage.png().toBuffer();
|
||||
const outputBuffer: any = await processedImage.png().toBuffer();
|
||||
|
||||
return new NextResponse(outputBuffer, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
"Cache-Control":
|
||||
"public, max-age=31536000, immutable",
|
||||
"Cache-Control": "public, max-age=31536000, immutable",
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -90,4 +93,3 @@ export async function GET(
|
||||
return new NextResponse("Internal Server Error", { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
'use client'
|
||||
|
||||
import { memo, useMemo } from "react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useParams } from "next/navigation";
|
||||
import PlusIcon from "@/components/icons/PlusIcon";
|
||||
@@ -98,7 +98,7 @@ const MenuItem = ({ food }: MenuItemProps) => {
|
||||
return (
|
||||
<div className="flex gap-4 w-full h-full items-center">
|
||||
<Link href={foodDetailUrl} className="cursor-pointer">
|
||||
<Image
|
||||
<img
|
||||
className="rounded-xl bg-[#F2F2F9] min-w-28 w-28 object-cover"
|
||||
src={resolvedImage}
|
||||
height={112}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import React from 'react'
|
||||
|
||||
type Props = {
|
||||
isPending: boolean
|
||||
isPending: boolean,
|
||||
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void
|
||||
} & Omit<React.FormHTMLAttributes<HTMLFormElement>, 'id'>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
Reference in New Issue
Block a user