import React from "react"; import Modal from 'react-bootstrap/Modal' import {Form} from "react-bootstrap"; class NewTagPopup extends React.Component { constructor(props, context) { super(props, context); this.props = props; } render() { return ( <> Create a new Tag! Tag Name: This Tag will automatically show up on category page. ); } storeselection() { const updateRequest = new FormData(); updateRequest.append('action', 'createTag'); updateRequest.append('tagname', document.getElementById("namefield").value); fetch('/api/Tags.php', {method: 'POST', body: updateRequest}) .then((response) => response.json()) .then((result) => { if (result.result !== "success") { console.log("error occured while writing to db -- todo error handling"); console.log(result.result); } this.props.onHide(); }); } } export default NewTagPopup;