Skip to content

Decouple API from echo.Context #16

@seilagamo

Description

@seilagamo

I know this is something that was not introduced in this PR, and we don't need to modify it now, but I in future when we have time, I wouldn't pass the echo.Context to the methods defined in the API struct. That's because, by doing so, we are coupling the API with the HTTP library that we are using to expose it even if we don't need to. In this function, we don't use the context at all, in other cases where we are using the context to retrieve some parameters, for instance the teamID, we could just directly pass that parameter to the function. By not coupling the API with the HTTP framework we make it easy to test the component and reason about it.

Originally posted by @manelmontilla in #12 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions