neatnik/omg.lol

[Bug] API response for account info returns settings: false if settings are unconfigured

Opened this issue · 0 comments

Bug Description

When I first started using the API, the account/info endpoint returned this:

{
    "request": {
        "status_code": 200,
        "success": true
    },
    "response": {
        "message": "Here is the account info that you requested.",
        "email": "<email>",
        "name": "Elliott",
        "created": {
            "unix_epoch_time": "<time>",
            "iso_8601_time": "<time>",
            "rfc_2822_time": "<time>",
            "relative_time": "<time>"
        },
        "api_key": "<api key>",
        "settings": false
    }
}

However after changing a setting in the dashboard it will return the response as described in the docs:

{
    "request": {
        "status_code": 200,
        "success": true
    },
    "response": {
        "message": "Here is the account info that you requested.",
        "email": "<email>",
        "name": "Elliott",
        "created": {
            "unix_epoch_time": "<time>",
            "iso_8601_time": "<time>",
            "rfc_2822_time": "<time>",
            "relative_time": "<time>"
        },
        "api_key": "<api key>",
        "settings": {
            "owner": "<email>",
            "communication": "email_ok",
            "date_format": null,
            "web_editor": null
        }
    }
}

After reversing the setting change, the response continues to work as intended, it only appears to affect unconfigured accounts.

Steps to Reproduce

Create new account and query the account/info using the API.