Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ocs): list accounts and aliases of current user #10735

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Feb 20, 2025

Resolves #10588

Exemplary API response

GET https://localhost/ocs/v2.php/apps/mail/account/list

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 200,
      "message": "OK"
    },
    "data": [
      {
        "id": 1720,
        "email": "[email protected]",
        "aliases": [
          {
            "id": 51,
            "email": "[email protected]",
            "name": null
          }
        ]
      },
      {
        "id": 1724,
        "email": "[email protected]",
        "aliases": []
      },
      {
        "id": 2101,
        "email": "[email protected]",
        "aliases": [
          {
            "id": 49,
            "email": "[email protected]",
            "name": "catchall"
          }
        ]
      },
    ]
  }
}

@st3iny st3iny requested a review from GretaD as a code owner February 20, 2025 20:18
@st3iny st3iny requested a review from marcelklehr February 20, 2025 20:19
@st3iny
Copy link
Member Author

st3iny commented Feb 20, 2025

cc @marcelklehr in case you have remarks regarding the schema or you have suggestions for improvements

Comment on lines +20 to +21
* @method void setName(string|null $name)
* @method string|null getName()
Copy link
Member Author

@st3iny st3iny Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly related but I noticed that the DB schema allows null values but the entity does not. Otherwise, I can't write a unit test for null values of the name column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCS endpoint to get the account list
1 participant