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:
@@ -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'],
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user