Allow to unset birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
3193f18cf3
commit
fb268c4378
@ -545,11 +545,19 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
|
|||||||
description: "Invite token required when the registrations aren't public"
|
description: "Invite token required when the registrations aren't public"
|
||||||
},
|
},
|
||||||
birthday: %Schema{
|
birthday: %Schema{
|
||||||
type: :string,
|
|
||||||
nullable: true,
|
nullable: true,
|
||||||
description: "User's birthday",
|
description: "User's birthday",
|
||||||
|
anyOf: [
|
||||||
|
%Schema{
|
||||||
|
type: :string,
|
||||||
format: :date
|
format: :date
|
||||||
},
|
},
|
||||||
|
%Schema{
|
||||||
|
type: :string,
|
||||||
|
maxLength: 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
language: %Schema{
|
language: %Schema{
|
||||||
type: :string,
|
type: :string,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
@ -733,11 +741,19 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
|
|||||||
},
|
},
|
||||||
actor_type: ActorType,
|
actor_type: ActorType,
|
||||||
birthday: %Schema{
|
birthday: %Schema{
|
||||||
type: :string,
|
|
||||||
nullable: true,
|
nullable: true,
|
||||||
description: "User's birthday",
|
description: "User's birthday",
|
||||||
|
anyOf: [
|
||||||
|
%Schema{
|
||||||
|
type: :string,
|
||||||
format: :date
|
format: :date
|
||||||
},
|
},
|
||||||
|
%Schema{
|
||||||
|
type: :string,
|
||||||
|
maxLength: 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
show_birthday: %Schema{
|
show_birthday: %Schema{
|
||||||
allOf: [BooleanLike],
|
allOf: [BooleanLike],
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
@ -390,6 +390,20 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
|
|||||||
assert user_data["source"]["pleroma"]["show_birthday"] == true
|
assert user_data["source"]["pleroma"]["show_birthday"] == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "unsets birth date", %{conn: conn} do
|
||||||
|
patch(conn, "/api/v1/accounts/update_credentials", %{
|
||||||
|
"birthday" => "2001-02-12"
|
||||||
|
})
|
||||||
|
|
||||||
|
res =
|
||||||
|
patch(conn, "/api/v1/accounts/update_credentials", %{
|
||||||
|
"birthday" => ""
|
||||||
|
})
|
||||||
|
|
||||||
|
assert user_data = json_response_and_validate_schema(res, 200)
|
||||||
|
assert user_data["pleroma"]["birthday"] == nil
|
||||||
|
end
|
||||||
|
|
||||||
test "emojis in fields labels", %{conn: conn} do
|
test "emojis in fields labels", %{conn: conn} do
|
||||||
fields = [
|
fields = [
|
||||||
%{"name" => ":firefox:", "value" => "is best 2hu"},
|
%{"name" => ":firefox:", "value" => "is best 2hu"},
|
||||||
|
Loading…
Reference in New Issue
Block a user