File tree Expand file tree Collapse file tree 1 file changed +10
-25
lines changed Expand file tree Collapse file tree 1 file changed +10
-25
lines changed Original file line number Diff line number Diff line change @@ -12,33 +12,18 @@ class PvPTeam extends Lib {
1212 page int optional
1313 }
1414 */
15- search ( name , params = { } ) {
16- return new Promise ( ( resolve , reject ) => {
17- if ( typeof ( name ) === 'undefined' )
18- reject ( this . throwError ( 'pvpteam.search()' , 'a name' ) )
19-
20- this . req (
21- '/pvpteam/search' ,
22- Object . assign ( params , { name :name } )
23- ) . then ( ( res ) => {
24- resolve ( res )
25- } ) . catch ( ( err ) => {
26- reject ( err )
27- } )
28- } )
15+ async search ( name , params = { } ) {
16+ if ( typeof name === "undefined" )
17+ throw this . throwError ( `PvPTeam.search()` , 'a name' ) ;
18+
19+ return this . req ( `/pvpteam/search` , Object . assign ( { } , params , { name} ) ) ;
2920 }
3021
31- get ( id ) {
32- return new Promise ( ( resolve , reject ) => {
33- if ( typeof ( id ) === 'undefined' )
34- reject ( this . throwError ( 'pvpteam.get()' , 'an ID' ) )
35-
36- this . req ( '/pvpteam/' + id ) . then ( ( res ) => {
37- resolve ( res )
38- } ) . catch ( ( err ) => {
39- reject ( err )
40- } )
41- } )
22+ async get ( id ) {
23+ if ( typeof id === "undefined" )
24+ throw this . throwError ( `PvPTeam.get()` , 'an ID' ) ;
25+
26+ return this . req ( `/pvpteam/${ id } ` ) ;
4227 }
4328}
4429
You can’t perform that action at this time.
0 commit comments