]> git.somenet.org - pub/jan/aic18.git/blob - service-website/src/services/CamundaService.js
Remove headers
[pub/jan/aic18.git] / service-website / src / services / CamundaService.js
1 import axios from "axios";
2
3 class CamundaService {
4     constructor() {
5         this.axiosInstance = axios.create({
6             baseURL: 'http://localhost:8085/engine-rest/',
7         });
8         this.submitPdfForm = this.submitPdfForm.bind(this);
9     }
10
11     submitPdfForm(terms) {
12         const termsValue = [];
13         terms.forEach(term => {
14             termsValue.push({term});
15         });
16         console.log('termsValue: ', termsValue);
17         const submitFormUrl = 'process-definition/key/sentiment-analysis/submit-form';
18         const data = {
19             variables: {
20                 terms: {
21                     value: JSON.stringify(termsValue),
22                     type: "Json"
23                 }
24             }
25         };
26         this.axiosInstance
27             .post(submitFormUrl, data)
28             .then(response => {
29                 const data = response.data;
30                 console.log(data);
31             })
32             .catch(error => {
33                 console.log(error);
34             })
35     }
36 }
37
38 export default CamundaService;