Completed
Push — master ( 862cae...854c71 )
by Raimund
13s
created

src/services/requests.js (6 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
/**
2
 * Nextcloud - Tasks
3
 *
4
 * @author Raimund Schlüßler
5
 * @copyright 2018 Raimund Schlüßler <[email protected]>
6
 *
7
 * This library is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
9
 * License as published by the Free Software Foundation; either
10
 * version 3 of the License, or any later version.
11
 *
12
 * This library is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public
18
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 */
21
'use strict'
22
23
import Axios from 'axios'
0 ignored issues
show
'import' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
24
Axios.defaults.headers.common.requesttoken = OC.requestToken
25
26
export default {
0 ignored issues
show
'export' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
27
	get(url) {
28
		return Axios.get(url)
29
			.then((response) => Promise.resolve(response))
0 ignored issues
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
30
			.catch((error) => Promise.reject(error))
0 ignored issues
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
31
	},
32
	post(url, data) {
33
		return Axios.post(url, data)
34
			.then((response) => Promise.resolve(response))
0 ignored issues
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
35
			.catch((error) => Promise.reject(error))
0 ignored issues
show
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

Generally using ECMAScript 6 specific syntax is fine if you are sure that it is already supported by all engines which are supposed to run this code.

Further Reading:

Loading history...
36
	}
37
}
38