Skip to content

Commit

Permalink
Allow null description field value to round trip from server (#142540)
Browse files Browse the repository at this point in the history
  • Loading branch information
byronhulcher authored Oct 4, 2022
1 parent 8e770bb commit bcfa351
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ export type PutConnectorNameAndDescriptionArgs = Partial<
indexName: string;
};

export type PutConnectorNameAndDescriptionResponse = Partial<
Pick<Connector, 'name' | 'description'>
> & {
export type PutConnectorNameAndDescriptionResponse = Pick<Connector, 'name' | 'description'> & {
indexName: string;
};

export const putConnectorNameAndDescription = async ({
connectorId,
description,
description = null,
indexName,
name,
name = '',
}: PutConnectorNameAndDescriptionArgs) => {
const route = `/internal/enterprise_search/connectors/${connectorId}/name_and_description`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const ConnectorNameAndDescription: React.FC = () => {
title: NAME_LABEL,
},
{
description: description ?? '--',
description: description || '--',
title: DESCRIPTION_LABEL,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ export function registerConnectorRoutes({ router, log }: RouteDependencies) {
connectorId: schema.string(),
}),
body: schema.object({
name: schema.maybe(schema.string()),
description: schema.maybe(schema.string()),
name: schema.string(),
description: schema.nullable(schema.string()),
}),
},
},
Expand Down

0 comments on commit bcfa351

Please sign in to comment.