From 734a2405d3cfbf5e01997a7332b4a764c2f14776 Mon Sep 17 00:00:00 2001 From: Joonas Date: Thu, 12 Jan 2023 22:18:11 +0200 Subject: [PATCH] started implementing replying functionality, cleaned up --- .gitignore | 3 +- app/routes/index.jsx | 16 +- app/routes/threads/$threadId.jsx | 35 +- app/styles/app.css | 769 ------------------------------- prisma/schema.prisma | 29 +- 5 files changed, 51 insertions(+), 801 deletions(-) delete mode 100644 app/styles/app.css 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