Skip to content

Commit

Permalink
Fix 500 error on API DELETE endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Nov 3, 2023
1 parent ad9f47d commit 6126317
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed
- API DELETE endpoints for campaigns, contacts, segments now return the
correct 204 response


## Version 0.12.8

Expand Down
2 changes: 1 addition & 1 deletion lib/keila_web/api/controllers/api_campaign_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ defmodule KeilaWeb.ApiCampaignController do
Mailings.delete_project_campaigns(project_id(conn), [id])

conn
|> put_status(204)
|> send_resp(:no_content, "")
end

operation(:deliver,
Expand Down
2 changes: 1 addition & 1 deletion lib/keila_web/api/controllers/api_contact_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ defmodule KeilaWeb.ApiContactController do
Contacts.delete_project_contacts(project_id(conn), filter: %{"id" => id})

conn
|> put_status(204)
|> send_resp(:no_content, "")
end

defp project_id(conn), do: conn.assigns.current_project.id
Expand Down
2 changes: 1 addition & 1 deletion lib/keila_web/api/controllers/api_segment_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ defmodule KeilaWeb.ApiSegmentController do
Contacts.delete_project_segments(project_id(conn), [id])

conn
|> put_status(204)
|> send_resp(:no_content, "")
end

defp project_id(conn), do: conn.assigns.current_project.id
Expand Down

0 comments on commit 6126317

Please sign in to comment.