Fix how bulk delete operation gets called when no partition key

This commit is contained in:
Laurent Nguyen 2024-05-03 09:46:00 +02:00
parent 6f7b7220b4
commit 088389d413

View File

@ -813,7 +813,11 @@ const DocumentsTabComponent: React.FunctionComponent<{
_collection,
toDeleteDocumentIds.map((id) => ({
id: id.id(),
partitionKey: id.partitionKeyValue,
// bulk delete: if not partition key is specified, do not pass empty array, but undefined
partitionKey:
id.partitionKeyValue && Array.isArray(id.partitionKeyValue) && id.partitionKeyValue.length === 0
? undefined
: id.partitionKeyValue,
})),
)
.then(