lots of fixes

This commit is contained in:
2023-09-17 12:25:44 +02:00
parent 4d4bb81099
commit 6dd11300d3
12 changed files with 69 additions and 40 deletions

View File

@@ -94,6 +94,13 @@ export default {
},
cartHandling () {
for ( let ticket in this.selectedTickets ) {
let category = '';
const ticketSlice = ticket.slice( 0, ticket.indexOf( '_' ) );
for ( let letter in ticketSlice ) {
if ( !isNaN( ticketSlice[ letter ] ) ) {
category += parseInt( ticketSlice[ letter ] );
}
}
const options = {
method: 'post',
body: JSON.stringify( {
@@ -102,8 +109,8 @@ export default {
'ticketOption': ticket.substring( ticket.indexOf( '_' ) + 1 ),
'eventID': this.event.eventID,
'count': this.selectedTickets[ ticket ],
'category': ticket.slice( 0, ticket.indexOf( '_' ) ),
'name': this.event.categories[ ticket.slice( ticket.indexOf( '_' ) - 1, ticket.indexOf( '_' ) ) ].name + ' (' + this.event.ageGroups[ ticket.substring( ticket.indexOf( '_' ) + 1 ) ].name + ')',
'category': category,
'name': this.event.categories[ category ].name + ' (' + this.event.ageGroups[ ticket.substring( ticket.indexOf( '_' ) + 1 ) ].name + ')',
} ),
headers: {
'Content-Type': 'application/json',

View File

@@ -342,7 +342,7 @@
}
let lowestPrice = 1000000;
let totalSeats = parseInt( this.locations[ this.event.location ].totalSeats );
let totalSeats = parseInt( this.locations[ this.event.location ].totalSeats ?? 0 );
for ( let category in this.event.categories ) {
for ( let price in this.event.categories[ category ].price ) {
if ( this.event.categories[ category ].price[ price ] < 0.5 || ( !this.event.categories[ category ].ticketCount && this.hasSeatPlan ) ) {
@@ -383,6 +383,7 @@
if ( res.status === 200 ) {
if ( action === 'deploy' ) {
this.$refs.notification.createNotification( 'Your event has been published successfully.', 5, 'ok', 'normal' );
fetch( '/getAPI/reloadData' ).catch( () => {} );
this.hasLiveVersion = true;
} else {
this.$refs.notification.createNotification( 'Saved as draft successfully!', 5, 'ok', 'normal' );