Skip to content

Conversation

@abaevbog
Copy link
Contributor

Fixes: #153

@abaevbog abaevbog requested a review from dstillman June 22, 2023 20:23
// Sorting by Item Type or Added By currently require writing to shard tables, so don't
// send those to the read replicas
if ($this->queryParams['sort'] == 'itemType' || $this->queryParams['sort'] == 'addedBy') {
if ($this->queryParams['sort'] == 'itemType' || $this->queryParams['sort'] == 'addedBy' || $this->queryParams['sort'] == 'editedBy') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can switch this to in_array($this->queryParams['sort'], ['itemType', 'addedBy', 'editedBy'])



case 'editedBy':
case 'addedBy':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editedBy goes second, here and below

case 'editedBy':
case 'addedBy':
$isGroup = Zotero_Libraries::getType($libraryID) == 'group';
$userParameter = $params['sort'] == "editedBy" ? 'lastModifiedByUserID' : 'createdByUserID';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use == 'addedBy' instead

@abaevbog abaevbog requested a review from dstillman June 23, 2023 15:32
abaevbog added a commit to abaevbog/dataserver that referenced this pull request Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

editedBy item sort option for group libraries

2 participants