mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
return alias name in GET /api/v2/aliases
This commit is contained in:
parent
7a2fc007e8
commit
63af3297f7
@ -870,6 +870,7 @@ If success, 200 with the list of aliases. Each alias has the following fields:
|
|||||||
|
|
||||||
- id
|
- id
|
||||||
- email
|
- email
|
||||||
|
- name
|
||||||
- enabled
|
- enabled
|
||||||
- creation_timestamp
|
- creation_timestamp
|
||||||
- note
|
- note
|
||||||
@ -896,6 +897,7 @@ Here's an example:
|
|||||||
"creation_date": "2020-04-06 17:57:14+00:00",
|
"creation_date": "2020-04-06 17:57:14+00:00",
|
||||||
"creation_timestamp": 1586195834,
|
"creation_timestamp": 1586195834,
|
||||||
"email": "prefix1.cat@sl.local",
|
"email": "prefix1.cat@sl.local",
|
||||||
|
"name": "A Name",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"mailbox": {
|
"mailbox": {
|
||||||
@ -920,6 +922,7 @@ Here's an example:
|
|||||||
"creation_date": "2020-04-06 17:57:14+00:00",
|
"creation_date": "2020-04-06 17:57:14+00:00",
|
||||||
"creation_timestamp": 1586195834,
|
"creation_timestamp": 1586195834,
|
||||||
"email": "prefix0.hey@sl.local",
|
"email": "prefix0.hey@sl.local",
|
||||||
|
"name": null,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"mailbox": {
|
"mailbox": {
|
||||||
|
@ -47,6 +47,7 @@ def serialize_alias_info_v2(alias_info: AliasInfo) -> dict:
|
|||||||
"creation_timestamp": alias_info.alias.created_at.timestamp,
|
"creation_timestamp": alias_info.alias.created_at.timestamp,
|
||||||
"enabled": alias_info.alias.enabled,
|
"enabled": alias_info.alias.enabled,
|
||||||
"note": alias_info.alias.note,
|
"note": alias_info.alias.note,
|
||||||
|
"name": alias_info.alias.name,
|
||||||
# activity
|
# activity
|
||||||
"nb_forward": alias_info.nb_forward,
|
"nb_forward": alias_info.nb_forward,
|
||||||
"nb_block": alias_info.nb_blocked,
|
"nb_block": alias_info.nb_blocked,
|
||||||
|
@ -155,6 +155,7 @@ def test_get_aliases_v2(flask_client):
|
|||||||
# "email": "prefix1.yeah@sl.local",
|
# "email": "prefix1.yeah@sl.local",
|
||||||
# "enabled": true,
|
# "enabled": true,
|
||||||
# "id": 3,
|
# "id": 3,
|
||||||
|
# "name": "Hey hey",
|
||||||
# "latest_activity": {
|
# "latest_activity": {
|
||||||
# "action": "forward",
|
# "action": "forward",
|
||||||
# "contact": {
|
# "contact": {
|
||||||
@ -173,6 +174,7 @@ def test_get_aliases_v2(flask_client):
|
|||||||
# "nb_reply": 0,
|
# "nb_reply": 0,
|
||||||
# "note": null
|
# "note": null
|
||||||
# }
|
# }
|
||||||
|
assert "name" in r0
|
||||||
assert r0["email"].startswith("prefix1")
|
assert r0["email"].startswith("prefix1")
|
||||||
assert r0["latest_activity"]["action"] == "forward"
|
assert r0["latest_activity"]["action"] == "forward"
|
||||||
assert "timestamp" in r0["latest_activity"]
|
assert "timestamp" in r0["latest_activity"]
|
||||||
|
Loading…
Reference in New Issue
Block a user