Skip to content

Commit

Permalink
✨ Use POST /track instead of POST /events
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Mar 16, 2022
1 parent 43f7567 commit 3069f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function addEvent(Event $event): CallResult
$this->requestFactory
->createRequest(
"POST",
new Uri("{$this->rootUrl}/events")
new Uri("{$this->rootUrl}/track")
)
->withHeader("content-type", "application/json")
->withBody($body)
Expand Down
2 changes: 2 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ public function test_it_triggers_event_for_user()
$request = $http->getLastRequest();
$this->assertInstanceOf(RequestInterface::class, $request);
if ($request instanceof RequestInterface) {
$this->assertEquals("POST", $request->getMethod());
$this->assertEquals("/track", $request->getUri()->getPath());
$request->getBody()->rewind();
$body = $request->getBody()->getContents();
$payload = json_decode($body, true);
Expand Down

0 comments on commit 3069f67

Please sign in to comment.