From 9fc19b37d9777eee727aa31f57dc78bfd26b94e7 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 29 Nov 2020 16:23:44 -0600 Subject: [PATCH] fixed admin ticket submission to PUT instead of POST --- client/src/routes/admin/ManageTicket.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/routes/admin/ManageTicket.js b/client/src/routes/admin/ManageTicket.js index 40b09f0..65a5257 100644 --- a/client/src/routes/admin/ManageTicket.js +++ b/client/src/routes/admin/ManageTicket.js @@ -143,7 +143,10 @@ const TicketForm = ( }, [dataRefresh, selectedTicket]); const internalFormSubmit = async (e, data) => { - const response = await handleFormSubmit(e, data, "/ticket"); + /* Get ticket id from state */ + const ticket_id = data.filter(x => x.name === "ticket_id").map(y => y.value)[0]; + /* set 'put' arg to true */ + const response = await handleFormSubmit(e, data, `/ticket/${ticket_id}`, true); if (response.status === 201) { dispatch({ type: "CLEAR_FORM" }); }