Skip to content

Commit

Permalink
Switch to use ilike operator for WHERE filters #731
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Oct 28, 2021
1 parent 7795715 commit 8534879
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions packages/datagateway-common/src/api/datafiles.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('datafile api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('datafile api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('datafile api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('distinct', JSON.stringify(['name', 'title']));
Expand Down
6 changes: 3 additions & 3 deletions packages/datagateway-common/src/api/datasets.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('dataset api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('dataset api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -706,7 +706,7 @@ describe('dataset api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('distinct', JSON.stringify(['name', 'title']));
Expand Down
6 changes: 3 additions & 3 deletions packages/datagateway-common/src/api/facilityCycles.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('facility cycle api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('facility cycle api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -261,7 +261,7 @@ describe('facility cycle api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);

Expand Down
2 changes: 1 addition & 1 deletion packages/datagateway-common/src/api/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('generic api functions', () => {
const params = new URLSearchParams();
params.append('order', JSON.stringify('name asc'));
params.append('order', JSON.stringify('id asc'));
params.append('where', JSON.stringify({ name: { like: 'test' } }));
params.append('where', JSON.stringify({ name: { ilike: 'test' } }));
params.append('where', JSON.stringify({ title: { nlike: 'test' } }));
params.append(
'where',
Expand Down
2 changes: 1 addition & 1 deletion packages/datagateway-common/src/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const getApiParams = (props: {
if (filter.type === 'include') {
searchParams.append(
'where',
JSON.stringify({ [column]: { like: filter.value } })
JSON.stringify({ [column]: { ilike: filter.value } })
);
} else {
searchParams.append(
Expand Down
6 changes: 3 additions & 3 deletions packages/datagateway-common/src/api/instruments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('instrument api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('instrument api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('instrument api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);

Expand Down
22 changes: 11 additions & 11 deletions packages/datagateway-common/src/api/investigations.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -733,7 +733,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('distinct', JSON.stringify(['name', 'title']));
Expand Down Expand Up @@ -847,7 +847,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -891,7 +891,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -987,7 +987,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -1059,7 +1059,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -1177,7 +1177,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);

Expand Down Expand Up @@ -1210,7 +1210,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append(
Expand Down Expand Up @@ -1283,7 +1283,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);

Expand Down Expand Up @@ -1317,7 +1317,7 @@ describe('investigation api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append(
Expand Down
6 changes: 3 additions & 3 deletions packages/datagateway-common/src/api/studies.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('study api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(20));
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('study api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append('skip', JSON.stringify(0));
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('study api functions', () => {
params.append(
'where',
JSON.stringify({
name: { like: 'test' },
name: { ilike: 'test' },
})
);
params.append(
Expand Down

0 comments on commit 8534879

Please sign in to comment.