File tree 3 files changed +2
-28
lines changed
3 files changed +2
-28
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ Collection of small Topcoder-related functions.
11
11
* [ tc] ( #module_tc )
12
12
* [ .REVIEW_OPPORTUNITY_TYPES] ( #module_tc.REVIEW_OPPORTUNITY_TYPES )
13
13
* [ .getApiResponsePayload(res)] ( #module_tc.getApiResponsePayload ) ⇒ <code >Promise</code >
14
- * [ .getApiResponsePayloadV3(res)] ( #module_tc.getApiResponsePayloadV3 ) ⇒ <code >Promise</code >
15
14
16
15
<a name =" module_tc.REVIEW_OPPORTUNITY_TYPES " ></a >
17
16
@@ -32,15 +31,3 @@ an error in case of a failure response.
32
31
| --- | --- |
33
32
| res | <code >Object</code > |
34
33
35
- <a name =" module_tc.getApiResponsePayloadV3 " ></a >
36
-
37
- ### tc.getApiResponsePayloadV3(res) ⇒ <code >Promise</code >
38
- Gets payload from a standard success response from TC v3 API; or throws
39
- an error in case of a failure response.
40
-
41
- ** Kind** : static method of [ <code >tc</code >] ( #module_tc )
42
- ** Returns** : <code >Promise</code > - Resolves to the payload.
43
-
44
- | Param | Type |
45
- | --- | --- |
46
- | res | <code >Object</code > |
Original file line number Diff line number Diff line change 6
6
import { config , isomorphy } from 'topcoder-react-utils' ;
7
7
8
8
import logger from '../utils/logger' ;
9
- import { getApiResponsePayload , getApiResponsePayloadV3 } from '../utils/tc' ;
9
+ import { getApiResponsePayload } from '../utils/tc' ;
10
10
import { getApi } from './api' ;
11
11
12
12
let auth0 ;
@@ -148,7 +148,7 @@ class User {
148
148
*/
149
149
async getUserPublicV3 ( username ) {
150
150
const res = await this . private . api . get ( `/members/${ username } ` ) ;
151
- return getApiResponsePayloadV3 ( res ) ;
151
+ return getApiResponsePayload ( res ) ;
152
152
}
153
153
154
154
/**
Original file line number Diff line number Diff line change @@ -38,19 +38,6 @@ export async function getApiResponsePayload(res) {
38
38
return x . content ;
39
39
}
40
40
41
- /**
42
- * Gets payload from a standard success response from TC API v3; or throws
43
- * an error in case of a failure response.
44
- * @param {Object } res
45
- * @return {Promise } Resolves to the payload.
46
- */
47
- export async function getApiResponsePayloadV3 ( res ) {
48
- if ( ! res . ok ) throw new Error ( res . statusText ) ;
49
- const x = ( await res . json ( ) ) . result ;
50
- if ( ! x . success ) throw new Error ( x . content ) ;
51
- return x . content ;
52
- }
53
-
54
41
/**
55
42
* Gets payload from a standard success response from TC LOOKER API; or throws
56
43
* an error in case of a failure response.
You can’t perform that action at this time.
0 commit comments