fix(plan): allow empty notes, use local time for past-date gate
Three related fixes from manual smoke testing: - Zod schema: drop min(1) on note field across all four schemas — note is optional in real usage, and the modal initialized it to empty. - assertNotPastDate: replace toISOString() (UTC) with local-time getters to match the rest of the codebase. Fixes off-by-one near day boundaries. - createEntry / updateEntry: also check the date_to endpoint for past dates, so a range can't extend backwards into the past even when its start is today or future. Defense in depth. Modal: drop `required` attribute and asterisk from the note field. Tests: add 5 new cases covering empty note, past date HTTP rejection, and the new to-endpoint check in updateEntry.
This commit is contained in:
@@ -286,13 +286,12 @@ function EditForm(props: Props) {
|
||||
))}
|
||||
</select>
|
||||
</FormField>
|
||||
<FormField label="Text poznámky" required>
|
||||
<FormField label="Text poznámky (volitelný)">
|
||||
<textarea
|
||||
value={note}
|
||||
onChange={(e) => setNote(e.target.value)}
|
||||
maxLength={500}
|
||||
rows={3}
|
||||
required
|
||||
/>
|
||||
</FormField>
|
||||
</FormModal>
|
||||
|
||||
Reference in New Issue
Block a user