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