Skip to content

fix: validation of url fields#359

Open
jakub206 wants to merge 4 commits into
mainfrom
fix/better-url-validation
Open

fix: validation of url fields#359
jakub206 wants to merge 4 commits into
mainfrom
fix/better-url-validation

Conversation

@jakub206
Copy link
Copy Markdown
Collaborator

Fixed url validation

@github-actions
Copy link
Copy Markdown

Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it.

Copy link
Copy Markdown
Member

@michalges michalges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

można to zrobić trochę prościej, bezpośrenio używając z.string().startsWith()
https://zod.dev/api?id=strings#strings
Image

@jakub206 jakub206 linked an issue May 18, 2026 that may be closed by this pull request
@jakub206 jakub206 requested a review from michalges May 20, 2026 19:05
@jakub206 jakub206 dismissed michalges’s stale review May 20, 2026 19:13

zmiany wprowadzone

Comment thread src/schemas/optional-url-schema.ts Outdated
.string()
.trim()
.url(FORM_ERROR_MESSAGES.INVALID_URL)
.startsWith("http://", {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https zamiast http

Comment thread src/schemas/required-url-schema.ts Outdated
FORM_ERROR_MESSAGES.INVALID_URL,
);
).startsWith("http://", {
message: FORM_ERROR_MESSAGES.INVALID_URL,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ten błąd niewiele mówi użytkownikowi, może dodaj nowy w stylu "Adres URL powinien zaczynać się od https://"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zawęzić walidację pól URL

2 participants