Skip to content

Commit

Permalink
fix: prevent duplicate ticket_id received from expo
Browse files Browse the repository at this point in the history
  • Loading branch information
dtangdev committed Jun 14, 2024
1 parent 90ed801 commit 5c0802a
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 5c0802a

Please sign in to comment.