Remove useless promise transformation

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2018-10-08 15:29:37 +02:00
parent c5c576addd
commit 9d2a66967b
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
9 changed files with 19 additions and 29 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -91,28 +91,18 @@ export default {
}); });
}, },
get(url) { get(url) {
return axios.get(sanitize(url)) return axios.get(sanitize(url));
.then((response) => Promise.resolve(response))
.catch((error) => Promise.reject(error));
}, },
post(url, data) { post(url, data) {
return axios.post(sanitize(url), data) return axios.post(sanitize(url), data);
.then((response) => Promise.resolve(response))
.catch((error) => Promise.reject(error));
}, },
patch(url, data) { patch(url, data) {
return axios.patch(sanitize(url), data) return axios.patch(sanitize(url), data);
.then((response) => Promise.resolve(response))
.catch((error) => Promise.reject(error));
}, },
put(url, data) { put(url, data) {
return axios.put(sanitize(url), data) return axios.put(sanitize(url), data);
.then((response) => Promise.resolve(response))
.catch((error) => Promise.reject(error));
}, },
delete(url, data) { delete(url, data) {
return axios.delete(sanitize(url), { data: data }) return axios.delete(sanitize(url), { data: data });
.then((response) => Promise.resolve(response))
.catch((error) => Promise.reject(error));
} }
}; };