Skip to content

Commit

Permalink
Barcode scanner - better history support
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMikes committed May 13, 2024
1 parent 07ee4fb commit fe346cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/controllers/barcode_scanner_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class extends Controller {
console.log(result.text); // Log the barcode content
if (this.isValidEAN(result.text)) {
const finalUrl = this.urlValue.replace('EAN_PLACEHOLDER', result.text);
window.location.replace(finalUrl); // Redirect to the dynamically created URL
window.location.href = finalUrl; // Redirect to the dynamically created URL
} else {
console.log('Invalid EAN scanned:', result.text);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ScanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __invoke(null|string $code): Response
try {
$puzzle = $this->getPuzzleOverview->byEan($code);

return $this->redirectToRoute('puzzle_detail', [
return $this->forward('puzzle_detail', [
'puzzleId' => $puzzle->puzzleId,
]);
} catch (PuzzleNotFound) {
Expand Down

0 comments on commit fe346cb

Please sign in to comment.