Skip to content

Commit

Permalink
Cloner fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Apr 30, 2024
1 parent 11441d0 commit 71f9ef4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/services/BaseEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,12 @@ export default abstract class BaseEntityService extends HttpSession {
body = body.copy;
}
if (cloner) {
const c = cloner(new Cloner(body));
body = c.copy;
if (Array.isArray(body)) {
body = body.map((x) => cloner(new Cloner(body)).copy);
} else {
const c = cloner(new Cloner(body));
body = c.copy;
}
}
const result = await this.postJson({url, body});
mergeProperties(result, body);
Expand Down

0 comments on commit 71f9ef4

Please sign in to comment.