mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
add mailboxes to GET /api/custom_domains
This commit is contained in:
parent
6b79dbdd5c
commit
6c2daf1bb6
|
@ -16,6 +16,9 @@ def custom_domain_to_dict(custom_domain: CustomDomain):
|
|||
"catch_all": custom_domain.catch_all,
|
||||
"name": custom_domain.name,
|
||||
"random_prefix_generation": custom_domain.random_prefix_generation,
|
||||
"mailboxes": [
|
||||
{"id": mb.id, "email": mb.email} for mb in custom_domain.mailboxes
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
|
|
62
docs/api.md
62
docs/api.md
|
@ -632,32 +632,42 @@ Output:
|
|||
List of custom domains.
|
||||
|
||||
```json
|
||||
{
|
||||
"custom_domains": [
|
||||
{
|
||||
"catch_all": false,
|
||||
"creation_date": "2021-03-06 19:42:33+00:00",
|
||||
"creation_timestamp": 1615059753,
|
||||
"domain_name": "test1.org",
|
||||
"id": 1,
|
||||
"is_verified": true,
|
||||
"name": null,
|
||||
"nb_alias": 0,
|
||||
"random_prefix_generation": false
|
||||
},
|
||||
{
|
||||
"catch_all": false,
|
||||
"creation_date": "2021-03-06 19:42:33+00:00",
|
||||
"creation_timestamp": 1615059753,
|
||||
"domain_name": "test2.org",
|
||||
"id": 2,
|
||||
"is_verified": false,
|
||||
"name": null,
|
||||
"nb_alias": 0,
|
||||
"random_prefix_generation": false
|
||||
}
|
||||
]
|
||||
}
|
||||
[
|
||||
{
|
||||
"catch_all": false,
|
||||
"creation_date": "2021-03-10 21:36:08+00:00",
|
||||
"creation_timestamp": 1615412168,
|
||||
"domain_name": "test1.org",
|
||||
"id": 1,
|
||||
"is_verified": true,
|
||||
"mailboxes": [
|
||||
{
|
||||
"email": "a@b.c",
|
||||
"id": 1
|
||||
}
|
||||
],
|
||||
"name": null,
|
||||
"nb_alias": 0,
|
||||
"random_prefix_generation": false
|
||||
},
|
||||
{
|
||||
"catch_all": false,
|
||||
"creation_date": "2021-03-10 21:36:08+00:00",
|
||||
"creation_timestamp": 1615412168,
|
||||
"domain_name": "test2.org",
|
||||
"id": 2,
|
||||
"is_verified": false,
|
||||
"mailboxes": [
|
||||
{
|
||||
"email": "a@b.c",
|
||||
"id": 1
|
||||
}
|
||||
],
|
||||
"name": null,
|
||||
"nb_alias": 0,
|
||||
"random_prefix_generation": false
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
#### GET /api/custom_domains/:custom_domain_id/trash
|
||||
|
|
|
@ -28,6 +28,11 @@ def test_get_custom_domains(flask_client):
|
|||
assert domain["creation_date"]
|
||||
assert domain["creation_timestamp"]
|
||||
|
||||
assert domain["mailboxes"]
|
||||
for mailbox in domain["mailboxes"]:
|
||||
assert "id" in mailbox
|
||||
assert "email" in mailbox
|
||||
|
||||
|
||||
def test_get_custom_domain_trash(flask_client):
|
||||
user = login(flask_client)
|
||||
|
|
Loading…
Reference in a new issue