mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Keep old default behavior (to fix other tests)
This commit is contained in:
parent
99d7e8fcca
commit
68519d5713
4 changed files with 9 additions and 9 deletions
|
|
@ -1382,10 +1382,15 @@ Zotero.DataObject.prototype._finalizeErase = async function (env) {
|
|||
|
||||
|
||||
Zotero.DataObject.prototype.toResponseJSON = function (options = {}) {
|
||||
// Default to showing synced properties, since that's what the API does, and this function
|
||||
// is generally used to emulate the API
|
||||
options.syncedStorageProperties ??= true;
|
||||
options.syncedVersionProperty ??= true;
|
||||
|
||||
let uri = Zotero.URI.getObjectURI(this);
|
||||
var json = {
|
||||
key: this.key,
|
||||
version: this.clientVersion,
|
||||
version: options.syncedVersionProperty ? this.version : this.clientVersion,
|
||||
library: this.library.toResponseJSON({ ...options, includeGroupDetails: false }),
|
||||
links: {
|
||||
self: {
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ Zotero.Group.prototype.toResponseJSON = function (options = {}) {
|
|||
let uri = Zotero.URI.getGroupURI(this);
|
||||
return {
|
||||
id: this.id,
|
||||
version: this.clientVersion,
|
||||
version: options.syncedVersionProperty ? this.version : this.clientVersion,
|
||||
links: {
|
||||
self: {
|
||||
href: Zotero.URI.toAPIURL(uri, options.apiURL),
|
||||
|
|
|
|||
|
|
@ -5869,12 +5869,6 @@ Zotero.Item.prototype.toJSON = function (options = {}) {
|
|||
|
||||
|
||||
Zotero.Item.prototype.toResponseJSON = function (options = {}) {
|
||||
// Default to showing synced storage properties, since that's what the API does, and this function
|
||||
// is generally used to emulate the API
|
||||
if (options.syncedStorageProperties === undefined) {
|
||||
options.syncedStorageProperties = true;
|
||||
}
|
||||
|
||||
var json = this.constructor._super.prototype.toResponseJSON.call(this, options);
|
||||
|
||||
// creatorSummary
|
||||
|
|
|
|||
|
|
@ -900,7 +900,8 @@ async function toResponseJSON(dataObjectOrObjects, searchParams) {
|
|||
let responseJSON = dataObject.toResponseJSONAsync
|
||||
? await dataObject.toResponseJSONAsync({
|
||||
apiURL: `http://localhost:${Zotero.Server.port}/api/`,
|
||||
includeGroupDetails: true
|
||||
includeGroupDetails: true,
|
||||
syncedVersionProperty: false,
|
||||
})
|
||||
: dataObject;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue