Skip to content

Commit aeeae2d

Browse files
authored
toil(front): read org_id from headers (#477)
## πŸ“ Description Simple change to read org_id from headers instead of the form. ## βœ… Checklist - [x] I have tested this change - [x] ~This change requires documentation update~
1 parent 06467f9 commit aeeae2d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

β€Žfront/lib/front_web/controllers/organization_contacts_controller.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ defmodule FrontWeb.OrganizationContactsController do
5252

5353
def modify(conn, %{"organization_contacts" => contact}) do
5454
Watchman.benchmark(watchman_name(:create, :duration), fn ->
55+
org_id = conn.assigns.organization_id
56+
57+
contact = Map.put(contact, "org_id", org_id)
58+
5559
case OrganizationContacts.modify(contact) do
5660
{:ok, _resp} ->
5761
conn

β€Žfront/lib/front_web/templates/organization_contacts/_form_for_single_contact.html.eex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<p class="mv2 measure"> <%= extract_contact_type_description(@contact_changeset) %></p>
44

55
<%= form_for @contact_changeset, organization_contacts_path(@conn, :modify), [method: :post], fn f -> %>
6-
<%= hidden_input f, :org_id, value: input_value(f, :org_id) %>
76
<%= hidden_input f, :contact_type, value: input_value(f, :contact_type) %>
87

98
<%= label f, :name, "Full Name", class: "db b mv2" %>

0 commit comments

Comments
Β (0)