Allow null description field value to round trip from server (#142540) (#142592)

(cherry picked from commit bcfa351f06)

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
This commit is contained in:
Kibana Machine 2022-10-04 07:23:37 -06:00 committed by GitHub
parent 3140395f7d
commit 695718b56d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View file

@ -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`;

View file

@ -65,7 +65,7 @@ export const ConnectorNameAndDescription: React.FC = () => {
title: NAME_LABEL,
},
{
description: description ?? '--',
description: description || '--',
title: DESCRIPTION_LABEL,
},
]}

View file

@ -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()),
}),
},
},