Skip to content

Commit

Permalink
fix(utils): fix incorrect commenting of CRUDHelper
Browse files Browse the repository at this point in the history
This was invardently commented during refactoring  of v6  to v8
  • Loading branch information
azlam committed Jun 30, 2024
1 parent 8003a4f commit aa4f73a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/utils/ObjectCRUDHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ export default class ObjectCRUDHelper {
return retry(
async (bail) => {
let result = await conn.update(sObject, record);
// if (isArray(result)) {
// let isAllRecordsSucceeded = true;
// for (const individualResult of result as SaveResult[]) {
// if (!individualResult.success) {
// isAllRecordsSucceeded = false;
// }
// }
// if (isAllRecordsSucceeded) return 'All records updated';
// else throw new Error('Some records have been failed to update');
// } else
if (isArray(result)) {
let isAllRecordsSucceeded = true;
for (const individualResult of result as SaveResult[]) {
if (!individualResult.success) {
isAllRecordsSucceeded = false;
}
}
if (isAllRecordsSucceeded) return 'All records updated';
else throw new Error('Some records have been failed to update');
} else
if ((result as SaveResult).success) return (result as SaveResult).id;
else bail();
},
Expand Down

0 comments on commit aa4f73a

Please sign in to comment.