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" }); }