diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-29 11:38:53 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-13 13:53:58 +0200 |
commit | 793e86fce66f356099792b7231c9a1d949ff875e (patch) | |
tree | 8bd08099539c3cb1ff159823ee1d1f74a5f2c979 /server/sonar-web/src/main/js/helpers/request.ts | |
parent | 736e89cc1629e1e52db00f67e4650f1b88695de9 (diff) | |
download | sonarqube-793e86fce66f356099792b7231c9a1d949ff875e.tar.gz sonarqube-793e86fce66f356099792b7231c9a1d949ff875e.zip |
update prettier
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/request.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/request.ts | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/helpers/request.ts b/server/sonar-web/src/main/js/helpers/request.ts index 1acb519e000..1abef7a8399 100644 --- a/server/sonar-web/src/main/js/helpers/request.ts +++ b/server/sonar-web/src/main/js/helpers/request.ts @@ -156,14 +156,23 @@ export function parseJSON(response: Response): Promise<any> { * Shortcut to do a GET request and return response json */ export function getJSON(url: string, data?: RequestData): Promise<any> { - return request(url).setData(data).submit().then(checkStatus).then(parseJSON); + return request(url) + .setData(data) + .submit() + .then(checkStatus) + .then(parseJSON); } /** * Shortcut to do a POST request and return response json */ export function postJSON(url: string, data?: RequestData): Promise<any> { - return request(url).setMethod('POST').setData(data).submit().then(checkStatus).then(parseJSON); + return request(url) + .setMethod('POST') + .setData(data) + .submit() + .then(checkStatus) + .then(parseJSON); } /** @@ -171,9 +180,14 @@ export function postJSON(url: string, data?: RequestData): Promise<any> { */ export function post(url: string, data?: RequestData): Promise<void> { return new Promise((resolve, reject) => { - request(url).setMethod('POST').setData(data).submit().then(checkStatus).then(() => { - resolve(); - }, reject); + request(url) + .setMethod('POST') + .setData(data) + .submit() + .then(checkStatus) + .then(() => { + resolve(); + }, reject); }); } @@ -181,7 +195,11 @@ export function post(url: string, data?: RequestData): Promise<void> { * Shortcut to do a POST request and return response json */ export function requestDelete(url: string, data?: RequestData): Promise<any> { - return request(url).setMethod('DELETE').setData(data).submit().then(checkStatus); + return request(url) + .setMethod('DELETE') + .setData(data) + .submit() + .then(checkStatus); } /** |