Skip to content

Commit

Permalink
SK-1090 Remove Get call from batch Insert
Browse files Browse the repository at this point in the history
- Fix default insert response where tokens are not present even if they were passed as true
  • Loading branch information
skyflow-vivek committed Jan 9, 2024
1 parent 7834c67 commit 1437279
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/vault-api/core/Collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,24 @@ export const constructInsertRecordResponse = (
return {
records: responseBody.responses
.map((res, index) => {
const skyflowId = responseBody.responses[index].records[0].skyflow_id;
return {
table: records[index].table,
fields: {
skyflow_id: skyflowId,
...res.tokens,
},
};
const skyflowId = responseBody.responses[index].records[0].skyflow_id;
const tokens = res.records[0].tokens;
return {
table: records[index].table,
fields: {
skyflow_id: skyflowId,
...tokens,
},
"request_index": index,
};
}),
};
}
return {
records: responseBody.responses.map((res, index) => ({
table: records[index].table,
skyflow_id: res.records[0].skyflow_id,
"request_index": index
})),
};
};

0 comments on commit 1437279

Please sign in to comment.