remove requirement for note and content to have content
This commit is contained in:
parent
8666f663ba
commit
d09f698b71
@ -1,5 +1,6 @@
|
|||||||
# v0.1.15
|
# v0.1.15
|
||||||
- Sanitize titles while they are being typed
|
- Sanitize titles while they are being typed
|
||||||
|
- Remove requirement for note and content to have content
|
||||||
- Prevent possible additional submissions
|
- Prevent possible additional submissions
|
||||||
- Fix content being displayed when blank
|
- Fix content being displayed when blank
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ defmodule Memex.Contexts.Context do
|
|||||||
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
||||||
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
||||||
)
|
)
|
||||||
|> validate_required([:slug, :content, :user_id, :visibility])
|
|> validate_required([:slug, :user_id, :visibility])
|
||||||
|> unique_constraint(:slug)
|
|> unique_constraint(:slug)
|
||||||
|> unsafe_validate_unique(:slug, Repo)
|
|> unsafe_validate_unique(:slug, Repo)
|
||||||
end
|
end
|
||||||
@ -70,7 +70,7 @@ defmodule Memex.Contexts.Context do
|
|||||||
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
||||||
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
||||||
)
|
)
|
||||||
|> validate_required([:slug, :content, :visibility])
|
|> validate_required([:slug, :visibility])
|
||||||
|> unique_constraint(:slug)
|
|> unique_constraint(:slug)
|
||||||
|> unsafe_validate_unique(:slug, Repo)
|
|> unsafe_validate_unique(:slug, Repo)
|
||||||
end
|
end
|
||||||
|
@ -56,7 +56,7 @@ defmodule Memex.Notes.Note do
|
|||||||
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
||||||
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
||||||
)
|
)
|
||||||
|> validate_required([:slug, :content, :user_id, :visibility])
|
|> validate_required([:slug, :user_id, :visibility])
|
||||||
|> unique_constraint(:slug)
|
|> unique_constraint(:slug)
|
||||||
|> unsafe_validate_unique(:slug, Repo)
|
|> unsafe_validate_unique(:slug, Repo)
|
||||||
end
|
end
|
||||||
@ -69,7 +69,7 @@ defmodule Memex.Notes.Note do
|
|||||||
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
|> validate_format(:slug, ~r/^[\p{L}\p{N}\-]+$/,
|
||||||
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
message: dgettext("errors", "invalid format: only numbers, letters and hyphen are accepted")
|
||||||
)
|
)
|
||||||
|> validate_required([:slug, :content, :visibility])
|
|> validate_required([:slug, :visibility])
|
||||||
|> unique_constraint(:slug)
|
|> unique_constraint(:slug)
|
||||||
|> unsafe_validate_unique(:slug, Repo)
|
|> unsafe_validate_unique(:slug, Repo)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user