"use strict";(self.webpackChunksmu_app=self.webpackChunksmu_app||[]).push([[477,9347,6160],{7754:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var a=n(7326),u=n(4578),l=n(7294),s=n(9325),r=n(2945),i=n(6613),o=n(613),d=n(8642),c=n(5444),m=(n(6633),function(e){function t(t){var n;return(n=e.call(this,t)||this).onChangeFirst=n.onChangeFirst.bind((0,a.Z)(n)),n.onChangeLast=n.onChangeLast.bind((0,a.Z)(n)),n.onChangeId=n.onChangeId.bind((0,a.Z)(n)),n.onChangeCourse=n.onChangeCourse.bind((0,a.Z)(n)),n.saveStudent=n.saveStudent.bind((0,a.Z)(n)),n.newStudent=n.newStudent.bind((0,a.Z)(n)),n.state={Stu_firstname:"",Stu_lastname:"",Stu_id:"",Course_name:"",submitted:!1},n}(0,u.Z)(t,e);var n=t.prototype;return n.onChangeFirst=function(e){this.setState({Stu_firstname:e.target.value})},n.onChangeLast=function(e){this.setState({Stu_lastname:e.target.value})},n.onChangeId=function(e){this.setState({Stu_id:e.target.value})},n.onChangeCourse=function(e){this.setState({Course_name:e.target.value})},n.saveStudent=function(){var e=this,t={Stu_firstname:this.state.Stu_firstname,Stu_lastname:this.state.Stu_lastname,Stu_id:this.state.Stu_id,Course_name:this.state.Course_name};s.default.create(t).then((function(t){e.setState({Stu_firstname:t.data.Stu_firstname,Stu_lastname:t.data.Stu_lastname,Stu_id:t.data.Stu_id,Course_name:t.data.Course_name,submitted:!0}),console.log(t.data)})).catch((function(e){console.log(e)}))},n.newStudent=function(){this.setState({Stu_firstname:"",Stu_lastname:"",Stu_id:"",Course_name:"",submitted:!1})},n.render=function(){return l.createElement("div",{className:"submit-form"},this.state.submitted?l.createElement("div",null,l.createElement("h4",null,"You submitted successfully!"),l.createElement("button",{className:"btn btn-success",onClick:this.newStudent},"Add")):l.createElement(r.Z,{fluid:!0,className:"container"},l.createElement(i.Z,{as:"h3"},"Please fill out the following information for the new student."),l.createElement("div",null),l.createElement("br",null),l.createElement(o.Z,{className:"form"},l.createElement(o.Z.Field,null,l.createElement("p",null,"Student First Name"),l.createElement("textarea",{id:"Stu_firstname",name:"Stu_firstname",rows:"1",cols:"50",onChange:this.onChangeFirst,value:this.state.Stu_firstname})),l.createElement("div",null),l.createElement("br",null),l.createElement(o.Z.Field,null,l.createElement("p",null,"Student Last Nme"),l.createElement("textarea",{id:"Stu_lastname",name:"Stu_lastname",rows:"1",cols:"50",onChange:this.onChangeLast,value:this.state.Stu_lastname})),l.createElement("div",null),l.createElement("br",null),l.createElement(o.Z.Field,null,l.createElement("p",null,"Student ID"),l.createElement("textarea",{id:"Stu_id",name:"Stu_id",rows:"1",cols:"25",onChange:this.onChangeId,value:this.state.Stu_id})),l.createElement("div",null),l.createElement("br",null),l.createElement(o.Z.Field,null,l.createElement("p",null,"Course ID"),l.createElement("select",{name:"Course_id",id:"Course_id",onChange:this.onChangeCourse,value:this.state.Course_id},l.createElement("option",{value:"default",selected:"true"},"Choose a Course ID"),l.createElement("option",null,"Managing Risk with Derivatives - 85098"),l.createElement("option",null,"Business Analysis - 89503"),l.createElement("option",null,"Networks Telecommunication - 47329"))),l.createElement("div",null),l.createElement("br",null),l.createElement(d.Z,{color:"black",type:"submit",onClick:this.saveStudent},"Add Student"),l.createElement(d.Z,{variant:"outline-light",size:"lg"},l.createElement(c.rU,{to:"/professoraddstudent"},"Back")))))},t}(l.Component))},2559:function(e,t,n){n.r(t);var a=n(6633),u=n.n(a);t.default=u().create({baseURL:"http://localhost:8020/api",headers:{"Content-Type":"application/json"}})},9325:function(e,t,n){n.r(t);var a=n(2559),u=function(){function e(){}var t=e.prototype;return t.getAll=function(){return a.default.get("/students/")},t.get=function(e){return a.default.get("/students/"+e)},t.create=function(e){return a.default.post("/students",e)},t.update=function(e,t){return a.default.put("/students/"+e,t)},t.delete=function(e){return a.default.delete("/students/"+e)},t.deleteAll=function(){return a.default.delete("/students/")},e}();t.default=new u}}]);
//# sourceMappingURL=component---src-pages-addstudentmanually-js-608d5a8a684b7796291a.js.map