diff --git a/.gitignore b/.gitignore index 7e86b31..21114af 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules /public/build .env /public/uploads -/prisma/dev.db \ No newline at end of file +/prisma/dev.db +/app/styles \ No newline at end of file diff --git a/app/routes/index.jsx b/app/routes/index.jsx index db7254c..1107386 100644 --- a/app/routes/index.jsx +++ b/app/routes/index.jsx @@ -25,14 +25,14 @@ export async function action({ request }) { multiPartformdata = await unstable_parseMultipartFormData(request, fileUploadHandler); imageName = multiPartformdata.get("image").name; } catch (err) { - errors.image = "Image size too big or something elase happened"; + errors.image = "Image size too big"; } - if (typeof title !== "string" || title.length > 50) { - errors.title = "Title too long or not a string"; + if (typeof title !== "string" || title.length > 50 || title.length < 3) { + errors.title = "Title too long or short"; }; - if (typeof post !== "string" || post.length > 50) { - errors.post = "Post too long or not a string"; + if (typeof post !== "string" || post.length > 50 || post.length < 3) { + errors.post = "Post too long or short"; }; if (Object.keys(errors).length) { return json(errors, { status: 422 }); @@ -69,12 +69,12 @@ export default function Index() {

Create a thread