From de495b9afe7ad6d8e9f3bd5a4922a19ef5635157 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sun, 15 Nov 2020 19:13:00 +0100 Subject: [PATCH] return nb_alias in GET /api/custom_domains --- app/api/views/custom_domain.py | 1 + docs/api.md | 2 ++ tests/api/test_custom_domain.py | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/views/custom_domain.py b/app/api/views/custom_domain.py index 98bfe5bd..ae1873a7 100644 --- a/app/api/views/custom_domain.py +++ b/app/api/views/custom_domain.py @@ -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(), } diff --git a/docs/api.md b/docs/api.md index 69a29ec8..b9c38ba9 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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 } ] diff --git a/tests/api/test_custom_domain.py b/tests/api/test_custom_domain.py index 1a4cf680..a254544e 100644 --- a/tests/api/test_custom_domain.py +++ b/tests/api/test_custom_domain.py @@ -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}, ] }