Compare commits

...

2 Commits

Author SHA1 Message Date
Laurent Nguyen
b862166862 Fix format 2026-01-15 15:40:56 +01:00
Laurent Nguyen
9a326c3b26 Fix error message in bulk delete to reflect total document count 2026-01-15 14:46:11 +01:00

View File

@@ -44,7 +44,8 @@ export const deleteDocuments = async (
documentIds: DocumentId[],
abortSignal: AbortSignal,
): Promise<IBulkDeleteResult[]> => {
const clearMessage = logConsoleProgress(`Deleting ${documentIds.length} ${getEntityName(true)}`);
const totalCount = documentIds.length;
const clearMessage = logConsoleProgress(`Deleting ${totalCount} ${getEntityName(true)}`);
try {
const v2Container = await client().database(collection.databaseId).container(collection.id());
@@ -83,11 +84,7 @@ export const deleteDocuments = async (
const flatAllResult = Array.prototype.concat.apply([], allResult);
return flatAllResult;
} catch (error) {
handleError(
error,
"DeleteDocuments",
`Error while deleting ${documentIds.length} ${getEntityName(documentIds.length > 1)}`,
);
handleError(error, "DeleteDocuments", `Error while deleting ${totalCount} ${getEntityName(totalCount > 1)}`);
throw error;
} finally {
clearMessage();