return nb_alias in GET /api/custom_domains

This commit is contained in:
Son NK 2020-11-15 19:13:00 +01:00
parent 9d24b1b88a
commit de495b9afe
3 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,7 @@ def custom_domain_to_dict(custom_domain: CustomDomain):
"id": custom_domain.id,
"domain": custom_domain.domain,
"verified": custom_domain.verified,
"nb_alias": custom_domain.nb_alias(),
}

View File

@ -639,11 +639,13 @@ List of custom domains.
{
"domain": "test1.org",
"id": 1,
"nb_alias": 0,
"verified": true
},
{
"domain": "test2.org",
"id": 2,
"nb_alias": 0,
"verified": false
}
]

View File

@ -19,7 +19,7 @@ def test_get_custom_domains(flask_client):
assert r.status_code == 200
assert r.json == {
"custom_domains": [
{"domain": "test1.org", "id": 1, "verified": True},
{"domain": "test2.org", "id": 2, "verified": False},
{"domain": "test1.org", "id": 1, "nb_alias": 0, "verified": True},
{"domain": "test2.org", "id": 2, "nb_alias": 0, "verified": False},
]
}