Skip to content

Commit fdd7e95

Browse files
committed
performance fix for entity api
1 parent b0ea6b6 commit fdd7e95

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • src/core/resources/entity

src/core/resources/entity/api.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ export async function pushEntities(
66
entities: Entity[]
77
): Promise<SyncEntitiesResponse> {
88
const appClient = getAppClient();
9-
const schemaSyncPayload = entities.reduce((acc, current) => {
10-
return {
11-
...acc,
12-
[current.name]: current,
13-
};
14-
}, {});
9+
const schemaSyncPayload = Object.fromEntries(
10+
entities.map((entity) => [entity.name, entity])
11+
);
1512

1613
const response = await appClient.put("entities-schemas/sync-all", {
1714
json: {

0 commit comments

Comments
 (0)