Add a read-only library param to /connector/getSelectedCollection

Part of zotero/zotero-connectors#546
This commit is contained in:
Adomas Venčkauskas 2025-05-26 13:41:07 +03:00
parent 3ff13bc08d
commit 9d04392eb0

View file

@ -930,7 +930,8 @@ Zotero.Server.Connector.GetSelectedCollection.prototype = {
* @param {Function} sendResponseCallback function to send HTTP response
*/
init: function(postData, sendResponseCallback) {
var { library, collection, editable } = Zotero.Server.Connector.getSaveTarget(true);
let allowReadOnly = (postData.hasOwnProperty("switchToReadableLibrary")) ? !postData.switchToReadableLibrary : true;
var { library, collection, editable } = Zotero.Server.Connector.getSaveTarget(allowReadOnly);
var response = {
libraryID: library.libraryID,
libraryName: library.name,