Skip to content

Commit

Permalink
fixed admin ticket submission to PUT instead of POST
Browse files Browse the repository at this point in the history
  • Loading branch information
alxford45 committed Nov 29, 2020
1 parent 5f6b2d9 commit 9fc19b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/routes/admin/ManageTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down

0 comments on commit 9fc19b3

Please sign in to comment.