Don't treat singuler filter type as legacy

Instead it's a convenience type for when only a single instance
of a param is required.

Signed-off-by: Will Sewell <willsewell@monzo.com>
This commit is contained in:
Will
2021-04-28 14:23:10 +01:00
committed by Will Sewell
parent d1b1306d98
commit 17644ca68e
2 changed files with 3 additions and 4 deletions
@@ -76,7 +76,7 @@ describe('CatalogClient', () => {
expect(response).toEqual(defaultResponse);
});
it('builds entity search filters properly', async () => {
it('builds multiple entity search filters properly', async () => {
expect.assertions(2);
server.use(
@@ -107,7 +107,7 @@ describe('CatalogClient', () => {
expect(response.items).toEqual([]);
});
it('builds entity legacy search filters properly', async () => {
it('builds single entity search filter properly', async () => {
expect.assertions(2);
server.use(
@@ -119,7 +119,6 @@ describe('CatalogClient', () => {
const response = await client.getEntities(
{
// The legacy value of filter is not an array
filter: {
a: '1',
b: ['2', '3'],
+1 -1
View File
@@ -19,7 +19,7 @@ import { Entity, EntityName, Location } from '@backstage/catalog-model';
export type CatalogEntitiesRequest = {
filter?:
| Record<string, string | string[]>[]
| Record<string, string | string[]> // Legacy type preserved for backwards compatibility
| Record<string, string | string[]>
| undefined;
fields?: string[] | undefined;
};