Skip to content
Snippets Groups Projects
Commit cfb35afa authored by Pascal Osterwinter's avatar Pascal Osterwinter
Browse files

changed var to const, changed function to lambda.

parent 162b5a26
No related branches found
No related tags found
1 merge request!173Updated Javascript code snippet to upload an attachment
......@@ -43,16 +43,16 @@ Unvollständige Einreichungen, die durch das sendende System (Onlinedienst) nich
<TabItem value="js">
```js
var axios = require('axios');
const axios = require('axios');
var data = 'eyJhbGciOiJSU0Et...MRPcWqnLJDtp6ZA0Q';
const data = 'eyJhbGciOiJSU0Et...MRPcWqnLJDtp6ZA0Q';
const SUBMISSION_ID = "a562cf6a-3860-4a7e-96e3-1d01f8a5252d"
const ATTACHMENT_ID = "12399641-2067-4e8b-b049-91b2a6c90544"
const TOKEN = "eyJraWQiOiJHb2JOIiwi...Xh1TWcb2uhLVVnDBQ"
const SUBMISSION_API = "https://submission-api-testing.fit-connect.fitko.dev"
var config = {
const config = {
method: 'put',
url: SUBMISSION_API + '/v1/submissions/' + SUBMISSION_ID + '/attachments/' + ATTACHMENT_ID,
headers: {
......@@ -63,12 +63,8 @@ var config = {
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment