Don't accept libraryVersion in syncAPIClient::getVersions()
Since /settings is always called first with If-Modified-Since-Version, it's never necessary to include that in the versions request.
This commit is contained in:
parent
ae277391b6
commit
69e5c5ae05
1 changed files with 3 additions and 7 deletions
|
@ -158,9 +158,10 @@ Zotero.Sync.APIClient.prototype = {
|
||||||
* @param {Integer} libraryTypeID userID or groupID
|
* @param {Integer} libraryTypeID userID or groupID
|
||||||
* @param {String} objectType 'item', 'collection', 'search'
|
* @param {String} objectType 'item', 'collection', 'search'
|
||||||
* @param {Object} queryParams Query parameters (see buildRequestURI())
|
* @param {Object} queryParams Query parameters (see buildRequestURI())
|
||||||
* @return {Promise<Object>|FALSE} Object with 'libraryVersion' and 'results'
|
* @return {Promise<Object>|false} - Object with 'libraryVersion' and 'results', or false if
|
||||||
|
* nothing changed since specified library version
|
||||||
*/
|
*/
|
||||||
getVersions: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, objectType, queryParams, libraryVersion) {
|
getVersions: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, objectType, queryParams) {
|
||||||
var objectTypePlural = Zotero.DataObjectUtilities.getObjectTypePlural(objectType);
|
var objectTypePlural = Zotero.DataObjectUtilities.getObjectTypePlural(objectType);
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
|
@ -184,11 +185,6 @@ Zotero.Sync.APIClient.prototype = {
|
||||||
var options = {
|
var options = {
|
||||||
successCodes: [200, 304]
|
successCodes: [200, 304]
|
||||||
};
|
};
|
||||||
if (libraryVersion) {
|
|
||||||
options.headers = {
|
|
||||||
"If-Modified-Since-Version": libraryVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
var xmlhttp = yield this.makeRequest("GET", uri, options);
|
var xmlhttp = yield this.makeRequest("GET", uri, options);
|
||||||
if (xmlhttp.status == 304) {
|
if (xmlhttp.status == 304) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue