Skip to content

Commit

Permalink
New PauseUser request
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Jan 11, 2020
1 parent aeae1f7 commit 7a8594c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,14 @@ async function completePhoneVerification (t, phone, phoneCode) {
//
// For more information: https://docs.tonicpow.com/#aa499fdf-2492-43ee-99d4-fc9735676431
async function activateUser (t, userId) {
return tonicAxios.put(t.config.apiUrl + version + '/users/status/activate', { user_id: userId }, getOptions())
return tonicAxios.put(t.config.apiUrl + version + '/users/status/activate', { id: userId }, getOptions())
}

// pauseUser will pause a user account (all payouts go to internal address)
//
// For more information: https://docs.tonicpow.com/#3307310d-86a9-4a5c-84ff-c38c581c77e5
async function pauseUser (t, userId, reason) {
return tonicAxios.put(t.config.apiUrl + version + '/users/status/pause', { id: userId, reason: reason }, getOptions())
}

//
Expand Down Expand Up @@ -923,6 +930,17 @@ module.exports = {
}
})
},
pauseUser: async function (userId, reason) {
return new Promise(async (resolve, reject) => {
try {
initCheck(this.loaded)
let response = await pauseUser(this, userId, reason)
resolve(response.data)
} catch (e) {
reject(checkError(e))
}
})
},
createAdvertiserProfile: async function (profile, userSessionToken = '') {
return new Promise(async (resolve, reject) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tonicpow-js",
"version": "0.1.34",
"version": "0.1.35",
"description": "TonicPow API Library in JS - https://docs.tonicpow.com",
"main": "lib/api.js",
"repository": {
Expand Down

0 comments on commit 7a8594c

Please sign in to comment.