mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
app api fix
This commit is contained in:
1 parent
d37fcda0db
commit
a6c6a4feb0
5 files changed
+17
-7
No files matched your search
@@ -31,16 +31,16 @@ module.exports = ( app ) => {
|
|||||||
pwHandler.checkpassword( req.body.email, req.body.password ).then( status => {
|
pwHandler.checkpassword( req.body.email, req.body.password ).then( status => {
|
||||||
if ( status ) {
|
if ( status ) {
|
||||||
if ( status.status ) {
|
if ( status.status ) {
|
||||||
db.getDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.indexOf( '_' ) ) ).then( dat => {
|
db.getDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.lastIndexOf( '_' ) ) ).then( dat => {
|
||||||
if ( dat[ 0 ] ) {
|
if ( dat[ 0 ] ) {
|
||||||
const tickets = JSON.parse( dat[ 0 ][ 'tickets' ] );
|
const tickets = JSON.parse( dat[ 0 ][ 'tickets' ] );
|
||||||
const event = req.body.ticketID.slice( req.body.ticketID.indexOf( '_' ) + 1, req.body.ticketID.indexOf( '-' ) );
|
const event = req.body.ticketID.slice( req.body.ticketID.lastIndexOf( '_' ) + 1, req.body.ticketID.lastIndexOf( '-' ) );
|
||||||
const ticket = req.body.ticketID.slice( req.body.ticketID.indexOf( '-' ) + 1, req.body.ticketID.length );
|
const ticket = req.body.ticketID.slice( req.body.ticketID.lastIndexOf( '-' ) + 1, req.body.ticketID.length );
|
||||||
if ( tickets[ event ] ) {
|
if ( tickets[ event ] ) {
|
||||||
if ( tickets[ event ][ ticket ] ) {
|
if ( tickets[ event ][ ticket ] ) {
|
||||||
if ( !tickets[ event ][ ticket ][ 'invalidated' ] ) {
|
if ( !tickets[ event ][ ticket ][ 'invalidated' ] ) {
|
||||||
tickets[ event ][ ticket ][ 'invalidated' ] = true;
|
tickets[ event ][ ticket ][ 'invalidated' ] = true;
|
||||||
db.writeDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.indexOf( '_' ) ), { 'tickets': JSON.stringify( tickets ) } );
|
db.writeDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.lastIndexOf( '_' ) ), { 'tickets': JSON.stringify( tickets ) } );
|
||||||
res.send( 'ticketValid' );
|
res.send( 'ticketValid' );
|
||||||
} else {
|
} else {
|
||||||
res.send( 'ticketInvalid' );
|
res.send( 'ticketInvalid' );
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"setupDone":true,
|
"setupDone":true,
|
||||||
"twoFA":"enforce",
|
"twoFA":"enforce",
|
||||||
"twoFAMode":"enhanced",
|
"twoFAMode":"enhanced",
|
||||||
"db":"json",
|
"db":"mysql",
|
||||||
"payments":"stripe",
|
"payments":"stripe",
|
||||||
"name":"libreevent",
|
"name":"libreevent",
|
||||||
"yourDomain":"http://localhost:8080",
|
"yourDomain":"http://localhost:8080",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"test2":{"draft":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":352},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.007,"y":660.033,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.721,"y":669.847,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}},"save":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":0},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.375,"y":660.049,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.828,"y":670.99,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}}},"test":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":22}},"count":0},"data":{"1":{"x":427.696,"y":160.539,"h":371.324,"w":734.069,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}},"testLocationNoSeatplan":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":13,"1":13,"2":13,"3":13,"4":13,"startingRow":1}},"count":50},"data":{"1":{"x":370.138,"y":164.1,"h":288.088,"w":745.746,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}},"complexSeatplan":{"draft":{"seatInfo":{"details":{"1":{"0":14,"1":14,"2":14,"3":14,"4":14,"5":14,"6":14,"7":14,"startingRow":1},"2":{"0":2,"1":4,"2":5,"3":7,"4":8,"5":10,"6":11,"7":13,"startingRow":1},"3":{"0":2,"1":4,"2":6,"3":8,"4":10,"5":12,"startingRow":1},"4":{"0":9,"1":9,"2":9,"startingRow":1}},"count":244,"data":{"A":{"1":{"0":2,"1":4,"2":6,"3":8,"4":10,"5":12,"startingRow":1},"2":{"0":14,"1":14,"2":14,"3":14,"4":14,"5":14,"6":14,"7":14,"startingRow":1},"3":{"0":2,"1":4,"2":5,"3":7,"4":8,"5":10,"6":11,"7":13,"startingRow":1},"4":{"0":9,"1":9,"2":9,"startingRow":1}}}},"data":{"1":{"x":574.098,"y":146.907,"h":282.216,"w":475.515,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":1037.99,"y":164.215,"h":297.68,"w":589.562,"active":false,"draggable":true,"resizable":true,"id":2,"origin":1,"shape":"circular","type":"seat","startingRow":1,"seatNumberingPosition":3,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":262.887,"y":137.24,"h":322.809,"w":317.01,"active":false,"draggable":true,"resizable":true,"id":3,"origin":2,"shape":"trapezoid","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"4":{"x":715.206,"y":606.961,"h":119.845,"w":303.479,"active":false,"draggable":true,"resizable":true,"id":4,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":4,"sector":"A","text":{"text":"TestText","textLine truncated
|
{"test2":{"draft":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":352},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.007,"y":660.033,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.721,"y":669.847,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}},"save":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":0},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.375,"y":660.049,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.828,"y":670.99,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}}},"test":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":22}},"count":0},"data":{"1":{"x":427.696,"y":160.539,"h":371.324,"w":734.069,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}},"testLocationNoSeatplan":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":13,"1":13,"2":13,"3":13,"4":13,"startingRow":1}},"count":50},"data":{"1":{"x":370.138,"y":164.1,"h":288.088,"w":745.746,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}},"complexSeatplan":{"draft":{"seatInfo":{"details":{"1":{"0":14,"1":14,"2":14,"3":14,"4":14,"5":14,"6":14,"7":14,"startingRow":1},"2":{"0":2,"1":4,"2":5,"3":7,"4":8,"5":10,"6":11,"7":13,"startingRow":1},"3":{"0":2,"1":4,"2":6,"3":8,"4":10,"5":12,"startingRow":1},"4":{"0":9,"1":9,"2":9,"startingRow":1}},"count":244,"data":{"A":{"1":{"0":2,"1":4,"2":6,"3":8,"4":10,"5":12,"startingRow":1},"2":{"0":14,"1":14,"2":14,"3":14,"4":14,"5":14,"6":14,"7":14,"startingRow":1},"3":{"0":2,"1":4,"2":5,"3":7,"4":8,"5":10,"6":11,"7":13,"startingRow":1},"4":{"0":9,"1":9,"2":9,"startingRow":1}}}},"data":{"1":{"x":574.098,"y":146.907,"h":282.216,"w":475.515,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":1036.082,"y":162.371,"h":297.68,"w":589.562,"active":false,"draggable":true,"resizable":true,"id":2,"origin":1,"shape":"circular","type":"seat","startingRow":1,"seatNumberingPosition":3,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":262.887,"y":135.309,"h":322.809,"w":317.01,"active":false,"draggable":true,"resizable":true,"id":3,"origin":2,"shape":"trapezoid","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"4":{"x":715.206,"y":606.959,"h":119.845,"w":303.479,"active":false,"draggable":true,"resizable":true,"id":4,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":4,"sector":"A","text":{"text":"TestText","teLine truncated
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<div v-else-if="contentType === 'text'" class="options">
|
<div v-else-if="contentType === 'text'" class="options">
|
||||||
<h3>{{ data.message }}</h3>
|
<h3>{{ data.message }}</h3>
|
||||||
<input type="text" v-model="data.selected">
|
<input type="text" v-model="data.selected">
|
||||||
|
<p>{{ info }}</p>
|
||||||
<div class="button-wrapper">
|
<div class="button-wrapper">
|
||||||
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
|
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
|
||||||
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
|
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
|
||||||
@@ -108,10 +109,19 @@
|
|||||||
return {
|
return {
|
||||||
contentType: 'dropdown',
|
contentType: 'dropdown',
|
||||||
data: {},
|
data: {},
|
||||||
|
info: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closePopup( message ) {
|
closePopup( message ) {
|
||||||
|
if ( this.data.options.disallowedCharacters ) {
|
||||||
|
for ( let letter in this.data.selected ) {
|
||||||
|
if ( this.data.options.disallowedCharacters.includes( this.data.selected[ letter ] ) ) {
|
||||||
|
this.info = `Illegal character "${ this.data.selected[ letter ] }"`;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$( '#popup-backdrop' ).fadeOut( 300 );
|
$( '#popup-backdrop' ).fadeOut( 300 );
|
||||||
if ( message ) {
|
if ( message ) {
|
||||||
this.$emit( 'data', { 'data': this.data.selected, 'status': message } );
|
this.$emit( 'data', { 'data': this.data.selected, 'status': message } );
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
},
|
},
|
||||||
addEvent () {
|
addEvent () {
|
||||||
this.currentPopup = 'add';
|
this.currentPopup = 'add';
|
||||||
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', {}, 'text' );
|
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', { 'disallowedCharacters': [ '_', '-' ] }, 'text' );
|
||||||
},
|
},
|
||||||
setActiveTicket ( id ) {
|
setActiveTicket ( id ) {
|
||||||
sessionStorage.setItem( 'selectedTicket', id );
|
sessionStorage.setItem( 'selectedTicket', id );
|
||||||
|
|||||||
Reference in new issue
Block a user