Tickettyp entfernt
This commit is contained in:
@@ -118,7 +118,7 @@ export const Generate: React.FC = () => {
|
|||||||
|
|
||||||
<div className="bg-white p-3 md:p-4 rounded-lg inline-block mb-4 md:mb-6">
|
<div className="bg-white p-3 md:p-4 rounded-lg inline-block mb-4 md:mb-6">
|
||||||
<QRCodeSVG
|
<QRCodeSVG
|
||||||
value={JSON.stringify({ id: generatedTicket.id, type: generatedTicket.ticketType })}
|
value={generatedTicket.id}
|
||||||
size={180}
|
size={180}
|
||||||
level="H"
|
level="H"
|
||||||
className="md:w-[200px] md:h-[200px]"
|
className="md:w-[200px] md:h-[200px]"
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ export const Scan: React.FC = () => {
|
|||||||
async (decodedText) => {
|
async (decodedText) => {
|
||||||
try {
|
try {
|
||||||
scanner.clear();
|
scanner.clear();
|
||||||
const data = JSON.parse(decodedText);
|
const ticketId = decodedText;
|
||||||
const tickets = await getTickets('default-event'); // Hardcoded event
|
const tickets = await getTickets('default-event'); // Hardcoded event
|
||||||
const ticket = tickets.find(t => t.id === data.id);
|
const ticket = tickets.find(t => t.id === ticketId);
|
||||||
|
|
||||||
if (ticket) {
|
if (ticket) {
|
||||||
if (ticket.status === 'valid') {
|
if (ticket.status === 'valid') {
|
||||||
|
|||||||
@@ -26,12 +26,8 @@ export class TicketsService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Generate QR code buffer with same format as frontend
|
// Generate QR code buffer with ticket ID only
|
||||||
const qrCodeData = JSON.stringify({
|
const qrCodeBuffer = await QRCode.toBuffer(ticket.id, {
|
||||||
id: ticket.id,
|
|
||||||
type: ticket.ticketType
|
|
||||||
});
|
|
||||||
const qrCodeBuffer = await QRCode.toBuffer(qrCodeData, {
|
|
||||||
errorCorrectionLevel: 'H', // High error correction
|
errorCorrectionLevel: 'H', // High error correction
|
||||||
type: 'png', // Output as PNG image
|
type: 'png', // Output as PNG image
|
||||||
width: 250, // QR code width
|
width: 250, // QR code width
|
||||||
@@ -74,12 +70,8 @@ export class TicketsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Generate QR code buffer with same format as frontend
|
// Generate QR code buffer with ticket ID only
|
||||||
const qrCodeData = JSON.stringify({
|
const qrCodeBuffer = await QRCode.toBuffer(ticket.id, {
|
||||||
id: ticket.id,
|
|
||||||
type: ticket.ticketType
|
|
||||||
});
|
|
||||||
const qrCodeBuffer = await QRCode.toBuffer(qrCodeData, {
|
|
||||||
errorCorrectionLevel: 'H',
|
errorCorrectionLevel: 'H',
|
||||||
type: 'png',
|
type: 'png',
|
||||||
width: 250,
|
width: 250,
|
||||||
|
|||||||
Reference in New Issue
Block a user