Skip to content

Allow destroy routes to point at update actions. #251

@jimsynz

Description

@jimsynz

Is your feature request related to a problem? Please describe.
My resource has the following update action:

update :close do
  change set_attribute(:status, "closed")
end

When exposing it via JSON:API I think the most reasonable thing to do is expose it as a DELETE endpoint.

Describe the solution you'd like
Allow delete route entities to accept update actions in addition to destroy and generic actions.

Describe alternatives you've considered

routes do
  base "/tickets"
  patch :close, route: "/:id/close"
end

Express the feature either with a change to resource syntax, or with a change to the resource interface

routes do
  base "/tickets"
  delete :close
end

Additional context
🐚

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Someday

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions