Skip to content

Commit

Permalink
increase body limit to 10mb
Browse files Browse the repository at this point in the history
  • Loading branch information
htothenan1 committed Nov 20, 2023
1 parent c673b3c commit f71c378
Show file tree
Hide file tree
Showing 3 changed files with 355 additions and 341 deletions.
18 changes: 9 additions & 9 deletions app/components/Kitchen.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
FruitsIcon,
ReceiptIcon,
} from "@/data/icons"
import { veggiesTest, receiptTest } from "@/utils/openai"
import { veggiesTest } from "@/utils/openai"
import { addDays } from "date-fns"

const Kitchen = ({ items, user }) => {
Expand Down Expand Up @@ -121,16 +121,16 @@ const Kitchen = ({ items, user }) => {
const file = e.target.files[0]

// Check if a file is selected
if (!file) {
alert("No file selected.")
return
}
// if (!file) {
// alert("No file selected.")
// return
// }

// Check if the file size is greater than 1MB
if (file.size > 1024 * 1024) {
alert("File size should not exceed 1MB")
return // Exit the function if the file is too large
}
// if (file.size > 1024 * 1024) {
// alert("File size should not exceed 1MB")
// return // Exit the function if the file is too large
// }

const reader = new FileReader()

Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
experimental: {
serverActions: true,
serverActionsBodySizeLimit: "10mb",
},
images: {
domains: ["spoonacular.com"],
Expand Down
Loading

0 comments on commit f71c378

Please sign in to comment.