Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct query string #780

Merged
merged 2 commits into from Jun 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,7 @@
### Changes

- Small UX/UI fixes @sneridagh
- Fix query string search in subjects vocab field @gomez
- Removed the delete button from the title tile @pnicolli

### Internal
Expand Down
2 changes: 1 addition & 1 deletion src/actions/vocabularies/vocabularies.js
Expand Up @@ -25,7 +25,7 @@ export function getVocabulary(vocabNameOrURL, query = null, start = 0) {
);
let queryString = `b_start=${start}`;
if (query) {
queryString = `${queryString}&q=${query}`;
queryString = `${queryString}&title=${query}`;
}
return {
type: GET_VOCABULARY,
Expand Down
5 changes: 3 additions & 2 deletions src/actions/vocabularies/vocabularies.test.js
Expand Up @@ -5,13 +5,14 @@ describe('Vocabularies actions', () => {
describe('getVocabulary', () => {
it('should create an action to get a vocabulary', () => {
const vocabulary = 'plone.app.vocabularies.Keywords';
const action = getVocabulary(vocabulary);
const query = 'john';
const action = getVocabulary(vocabulary, query);

expect(action.type).toEqual(GET_VOCABULARY);
expect(action.vocabulary).toEqual(vocabulary);
expect(action.request.op).toEqual('get');
expect(action.request.path).toEqual(
`/@vocabularies/${vocabulary}?b_start=0`,
`/@vocabularies/${vocabulary}?b_start=0&title=${query}`,
);
});
});
Expand Down