Aug 11 2020 10:38 PM
I am trying to remove a connector from MSTeams, i have noticed that "registerOnRemoveHandler" method is executing twice, and in this method i have written AJAX calls for removing dependencies of connector, but as method is called twice, AJAX call also called twice.
i am not able to find why this is happening in this method.
Can someone help me with it??
Aug 13 2020 07:29 AM
@sunnykalola -Could you please check did you write two instance for the method? Also could you please conform are you implemented the method as documented here ?If no could you please share repro steps?
Aug 14 2020 04:18 AM
Thank You @Nikitha-MSFT . I haven't write 2 instance for the method. Also i have referred a link which you had shared there is one variable "removeCalled" which value is set as true and below that i have implement my AJAX call.but then also it's called twice.
below is a sample code :
microsoftTeams.settings.registerOnRemoveHandler(function (removeEvent) {
var removeCalled = true;
// AJAX Call
$.ajax({
url: "https://example.com",
type: "DELETE",
data: "string",
contentType: "application/json",
success: function () {
removeEvent.notifySuccess();
},
error: function () {
removeEvent.notifyFailure("Failed");
}
});
})
Aug 19 2020 04:15 AM
@sunnykalola - Could you please try the code mentioned in sample?