Skip to content

Stop using get_by!/2 in CodeCorps.ModelHelpers #324

@joshsmith

Description

@joshsmith

When using get_by!/2, plug uses a different conn than our original one. This breaks CORS by not allowing us to render out our CORS headers.

While this behavior was nice to get started with, it is not tenable moving forward.

We can either solve this by using Canary's load_resource to render json-api errors where needed, or by rendering our own errors in the controller.

Either way, we need to switch to get_by/2 and handle the if/else condition appropriately.

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