Skip to content

Commit

Permalink
Merge pull request #34 from YieldStudio/feat/prevent-duplicate-tickets
Browse files Browse the repository at this point in the history
fix: prevent duplicate ticket_id received from expo
  • Loading branch information
dtangdev authored Jun 14, 2024
2 parents 90ed801 + 5c0802a commit 90df528
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Storage/ExpoTicketStorageMysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public function retrieve(int $amount = 1000): Collection

public function store(string $ticketId, string $token): ExpoTicketDto
{
$expoTicket = ExpoTicket::create([
$expoTicket = ExpoTicket::firstOrCreate([
'ticket_id' => $ticketId,
], [
'ticket_id' => $ticketId,
'token' => $token,
]);
Expand Down

0 comments on commit 90df528

Please sign in to comment.