1
0
mirror of https://github.com/franjsco/tick3t synced 2025-06-05 22:19:18 +02:00

refactor: edit dotenv

This commit is contained in:
frab1t
2019-05-18 18:56:40 +02:00
parent cd22fd6a77
commit 7461424cc2
4 changed files with 18 additions and 11 deletions

View File

@ -31,11 +31,13 @@ class CreateTicket extends Component {
this.handleInputChange = this.handleInputChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.API_URL= process.env.REACT_APP_API_URL;
}
componentDidMount() {
fetch("http://localhost:3001/categories?type=ticketType", {
fetch(`${this.API_URL}categories?type=ticketType`, {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
@ -75,7 +77,7 @@ class CreateTicket extends Component {
return;
}
fetch("http://localhost:3001/tickets", {
fetch(`${this.API_URL}tickets`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(rest)