Fix connector server changes for async getTranslators()
This commit is contained in:
parent
f397b0e3d1
commit
efc4455476
1 changed files with 3 additions and 3 deletions
|
@ -87,17 +87,17 @@ Zotero.Server.Connector.GetTranslators.prototype = {
|
|||
*/
|
||||
"init":function(data, sendResponseCallback) {
|
||||
// Translator data
|
||||
var me = this;
|
||||
if(data.url) {
|
||||
var me = this;
|
||||
Zotero.Translators.getWebTranslatorsForLocation(data.url).then(function(data) {
|
||||
sendResponseCallback(200, "application/json",
|
||||
JSON.stringify(me._serializeTranslators(data[0])));
|
||||
});
|
||||
} else {
|
||||
Zotero.Translators.getAll().then(function(translators) {
|
||||
var responseData = this._serializeTranslators(translators);
|
||||
var responseData = me._serializeTranslators(translators);
|
||||
sendResponseCallback(200, "application/json", JSON.stringify(responseData));
|
||||
}).fail(function() {
|
||||
}).fail(function(e) {
|
||||
sendResponseCallback(500);
|
||||
throw e;
|
||||
}).done();
|
||||
|
|
Loading…
Reference in a new issue