Skip to content

Commit 5ff5a98

Browse files
AlexNavaravengrov
authored andcommitted
BKNDLSS-12166 (#33)
* http://bugs.backendless.com/browse/BKNDLSS-12166 * Add method declaration to backendless.d.ts * Add typescript tests for resendConfirmationEmail method
1 parent dddc9e6 commit 5ff5a98

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

libs/backendless.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,8 @@ declare module __Backendless {
805805

806806
isValidLogin():boolean;
807807
isValidLogin(async:Backendless.Async):XMLHttpRequest;
808+
809+
resendEmailConfirmation(email:string, async?:Backendless.Async):XMLHttpRequest;
808810
}
809811

810812
interface UtilsI {

libs/backendless.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,21 @@
19111911
return !!user;
19121912
}
19131913
}
1914+
},
1915+
1916+
resendEmailConfirmation: function(emailAddress, async) {
1917+
if(!emailAddress || emailAddress instanceof Async) {
1918+
throw "Email cannot be empty";
1919+
}
1920+
var responder = extractResponder(arguments);
1921+
var isAsync = !!responder;
1922+
1923+
return Backendless._ajax({
1924+
method : 'POST',
1925+
url : this.restUrl + "/resendconfirmation/" + emailAddress,
1926+
isAsync : isAsync,
1927+
asyncHandler: responder
1928+
});
19141929
}
19151930
};
19161931

@@ -4355,7 +4370,8 @@
43554370
'getCategories', 'deleteCategory', 'deletePoint']],
43564371
[UserService.prototype, ['register', 'getUserRoles', 'roleHelper', 'login', 'describeUserClass',
43574372
'restorePassword', 'logout', 'update', 'isValidLogin', 'loginWithFacebookSdk',
4358-
'loginWithGooglePlusSdk', 'loginWithGooglePlus', 'loginWithTwitter', 'loginWithFacebook']]
4373+
'loginWithGooglePlusSdk', 'loginWithGooglePlus', 'loginWithTwitter', 'loginWithFacebook',
4374+
'resendEmailConfirmation']]
43594375
].forEach(promisifyPack);
43604376

43614377
UserService.prototype.getCurrentUser = function() {

tests/tsd.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ function testUserService() {
389389

390390
bol = Backendless.UserService.isValidLogin();
391391
resultXHR = Backendless.UserService.isValidLogin(async);
392+
393+
Backendless.UserService.resendEmailConfirmation('email');
394+
Backendless.UserService.resendEmailConfirmation('email', async);
395+
392396
}
393397

394398
function testGoeService() {

0 commit comments

Comments
 (0)