mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
fixing error message when passwords do not match / fixing placeholder image
This commit is contained in:
@@ -58,7 +58,7 @@ export default async function userPlugin(fastify) {
|
|||||||
|
|
||||||
const { username, password, password2, isAdmin, userId } = request.body;
|
const { username, password, password2, isAdmin, userId } = request.body;
|
||||||
if (password !== password2) {
|
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)) {
|
if (nullOrEmpty(username) || nullOrEmpty(password) || nullOrEmpty(password2)) {
|
||||||
return reply.code(400).send({ error: 'Username and password are mandatory.' });
|
return reply.code(400).send({ error: 'Username and password are mandatory.' });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "fredy",
|
"name": "fredy",
|
||||||
"version": "21.1.0",
|
"version": "21.1.1",
|
||||||
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
|
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export default function UserTable({ user = [], onUserRemoval, onUserEdit } = {})
|
|||||||
{
|
{
|
||||||
title: 'Last login',
|
title: 'Last login',
|
||||||
dataIndex: 'lastLogin',
|
dataIndex: 'lastLogin',
|
||||||
render: (value) => format(value),
|
render: (value) => (value == null ? '---' : format(value)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Jobs',
|
title: 'Jobs',
|
||||||
|
|||||||
@@ -13,5 +13,3 @@ export function format(ts, showSeconds = true) {
|
|||||||
...(showSeconds ? { second: 'numeric' } : {}),
|
...(showSeconds ? { second: 'numeric' } : {}),
|
||||||
}).format(ts);
|
}).format(ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const roundToHour = (ts) => Math.ceil(ts / (1000 * 60 * 60)) * (1000 * 60 * 60);
|
|
||||||
|
|||||||
@@ -335,16 +335,12 @@ export default function ListingDetail() {
|
|||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24} lg={12}>
|
<Col span={24} lg={12}>
|
||||||
<div className="listing-detail__image-container">
|
<div
|
||||||
|
className={`listing-detail__image-container${!listing.image_url ? ' listing-detail__image-container--placeholder' : ''}`}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
src={listing.image_url ?? no_image}
|
src={listing.image_url ?? no_image}
|
||||||
fallback={
|
fallback={<img src={no_image} alt="No image available" />}
|
||||||
<img
|
|
||||||
src={no_image}
|
|
||||||
alt="No image available"
|
|
||||||
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
style={{ width: '100%', height: '100%' }}
|
style={{ width: '100%', height: '100%' }}
|
||||||
preview={!!listing.image_url}
|
preview={!!listing.image_url}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -69,6 +69,13 @@
|
|||||||
object-fit: cover !important;
|
object-fit: cover !important;
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--placeholder {
|
||||||
|
img,
|
||||||
|
.semi-image-img {
|
||||||
|
object-fit: contain !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__address-link {
|
&__address-link {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const UserMutator = function UserMutator() {
|
|||||||
navigate('/users');
|
navigate('/users');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.error(error.json.message);
|
Toast.error(error.json.error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user