Skip to content

Commit

Permalink
Move properties under the data object
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Mar 29, 2024
1 parent d36bf30 commit f13d528
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shepherd.js/src/utils/datarequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class DataRequest {
this.properties = properties;
}

async sendEvents(body: Record<string, unknown>) {
body['properties'] = this.properties;
async sendEvents(body: { data: Record<string, unknown> }) {
body.data['properties'] = this.properties;

try {
const response = await fetch(`${this.apiPath}/api/v1/actor`, {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/utils/datarequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('DataRequest', () => {
expect(dataRequester.properties).toMatchObject(defaultOptions[2]);
expect(typeof dataRequester.sendEvents).toBe('function');

const data = await dataRequester.sendEvents({});
const data = await dataRequester.sendEvents({ data: {} });

expect(data).toMatchObject({});
});
Expand Down

0 comments on commit f13d528

Please sign in to comment.