improvement: various

This commit is contained in:
Francesco Esposito 2019-07-25 09:54:38 +02:00
parent 70a378f7cd
commit 5d42e01fcf
1 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import {
} from 'reactstrap'; } from 'reactstrap';
import { config } from '../../config'; import { config } from '../../config';
import { getAuthHeader } from '../../utils/auth';
import Card from '../../components/Card'; import Card from '../../components/Card';
import Table from '../../components/Table'; import Table from '../../components/Table';
@ -28,7 +29,7 @@ class TicketManager extends Component {
status: '', status: '',
message: '', message: '',
error: '', error: '',
updateed: false, updated: false,
isLoading: false, isLoading: false,
}; };
@ -101,9 +102,14 @@ class TicketManager extends Component {
return; return;
} }
const header = new Headers();
header.append('authorization', getAuthHeader());
header.append('Content-Type','application/json')
fetch(`${config.baseURL}tickets/${params.ticketId}`, { fetch(`${config.baseURL}tickets/${params.ticketId}`, {
method: 'PUT', method: 'PUT',
headers: { 'Content-Type': 'application/json' }, headers: header,
body: JSON.stringify({ body: JSON.stringify({
status: this.state.status, status: this.state.status,
note: this.state.message note: this.state.message