Extend comment length
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m17s

This commit is contained in:
Ryan Freeman 2025-04-06 16:30:51 +01:00
parent e2387beaa3
commit 50c691d6a2
2 changed files with 3 additions and 5 deletions

View File

@ -42,7 +42,7 @@ export async function addComment(prevState: { message: string }, formData: FormD
const success_message = 'Thanks, your comment was submitted and is awaiting approval.' const success_message = 'Thanks, your comment was submitted and is awaiting approval.'
const schema = z.object({ const schema = z.object({
comment: z.string().min(1).max(255).trim(), comment: z.string().min(1).max(300),
slug: z.string(), slug: z.string(),
parent_id: z.string().optional() parent_id: z.string().optional()
}) })

View File

@ -3,7 +3,6 @@ import {
differenceInHours, differenceInHours,
differenceInMinutes, differenceInMinutes,
differenceInMonths, differenceInMonths,
differenceInSeconds,
differenceInWeeks, differenceInWeeks,
differenceInYears differenceInYears
} from 'date-fns' } from 'date-fns'
@ -17,8 +16,7 @@ export function getShortDurationFromNow(fromDateTime: string) {
{fn: differenceInWeeks, suffix: 'w'}, {fn: differenceInWeeks, suffix: 'w'},
{fn: differenceInDays, suffix: 'd'}, {fn: differenceInDays, suffix: 'd'},
{fn: differenceInHours, suffix: 'h'}, {fn: differenceInHours, suffix: 'h'},
{fn: differenceInMinutes, suffix: 'm'}, {fn: differenceInMinutes, suffix: 'm'}
{fn: differenceInSeconds, suffix: 's'}
] ]
for (const {fn, suffix} of units) { for (const {fn, suffix} of units) {
@ -28,5 +26,5 @@ export function getShortDurationFromNow(fromDateTime: string) {
} }
} }
return '0s' return '<1m'
} }