From 3de82dfa41cd7192df987e41525513609597a26b Mon Sep 17 00:00:00 2001 From: orangecoding Date: Sat, 2 May 2026 20:00:11 +0200 Subject: [PATCH] fixing error message when passwords do not match / fixing placeholder image --- lib/api/routes/userRoute.js | 2 +- package.json | 2 +- ui/src/components/table/UserTable.jsx | 2 +- ui/src/services/time/timeService.js | 2 -- ui/src/views/listings/ListingDetail.jsx | 12 ++++-------- ui/src/views/listings/ListingDetail.less | 7 +++++++ ui/src/views/user/mutation/UserMutator.jsx | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/api/routes/userRoute.js b/lib/api/routes/userRoute.js index 1f60c88..e44bb0b 100644 --- a/lib/api/routes/userRoute.js +++ b/lib/api/routes/userRoute.js @@ -58,7 +58,7 @@ export default async function userPlugin(fastify) { const { username, password, password2, isAdmin, userId } = request.body; if (password !== password2) { - return reply.code(400).send({ error: 'Passwords does not match' }); + return reply.code(400).send({ error: 'Passwords do not match.' }); } if (nullOrEmpty(username) || nullOrEmpty(password) || nullOrEmpty(password2)) { return reply.code(400).send({ error: 'Username and password are mandatory.' }); diff --git a/package.json b/package.json index 3c5ed97..62f14d2 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fredy", - "version": "21.1.0", + "version": "21.1.1", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { "prepare": "husky", diff --git a/ui/src/components/table/UserTable.jsx b/ui/src/components/table/UserTable.jsx index 66bfe4d..93a7e98 100644 --- a/ui/src/components/table/UserTable.jsx +++ b/ui/src/components/table/UserTable.jsx @@ -47,7 +47,7 @@ export default function UserTable({ user = [], onUserRemoval, onUserEdit } = {}) { title: 'Last login', dataIndex: 'lastLogin', - render: (value) => format(value), + render: (value) => (value == null ? '---' : format(value)), }, { title: 'Jobs', diff --git a/ui/src/services/time/timeService.js b/ui/src/services/time/timeService.js index 8c68914..091ff07 100644 --- a/ui/src/services/time/timeService.js +++ b/ui/src/services/time/timeService.js @@ -13,5 +13,3 @@ export function format(ts, showSeconds = true) { ...(showSeconds ? { second: 'numeric' } : {}), }).format(ts); } - -export const roundToHour = (ts) => Math.ceil(ts / (1000 * 60 * 60)) * (1000 * 60 * 60); diff --git a/ui/src/views/listings/ListingDetail.jsx b/ui/src/views/listings/ListingDetail.jsx index b4921bd..759145d 100644 --- a/ui/src/views/listings/ListingDetail.jsx +++ b/ui/src/views/listings/ListingDetail.jsx @@ -335,16 +335,12 @@ export default function ListingDetail() { -
+
No image available - } + fallback={No image available} style={{ width: '100%', height: '100%' }} preview={!!listing.image_url} /> diff --git a/ui/src/views/listings/ListingDetail.less b/ui/src/views/listings/ListingDetail.less index e394082..3d65a62 100644 --- a/ui/src/views/listings/ListingDetail.less +++ b/ui/src/views/listings/ListingDetail.less @@ -69,6 +69,13 @@ object-fit: cover !important; display: block !important; } + + &--placeholder { + img, + .semi-image-img { + object-fit: contain !important; + } + } } &__address-link { diff --git a/ui/src/views/user/mutation/UserMutator.jsx b/ui/src/views/user/mutation/UserMutator.jsx index cca5d32..dab8041 100644 --- a/ui/src/views/user/mutation/UserMutator.jsx +++ b/ui/src/views/user/mutation/UserMutator.jsx @@ -59,7 +59,7 @@ const UserMutator = function UserMutator() { navigate('/users'); } catch (error) { console.error(error); - Toast.error(error.json.message); + Toast.error(error.json.error); } };