mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
fix bug in seat plan editor (loading broken)
This commit is contained in:
@@ -113,11 +113,23 @@ class POSTHandler {
|
|||||||
reject( { 'code': 500, 'error': error } );
|
reject( { 'code': 500, 'error': error } );
|
||||||
} );
|
} );
|
||||||
} else if ( call === 'createAdminAccount' ) {
|
} else if ( call === 'createAdminAccount' ) {
|
||||||
db.writeDataSimple( 'admin', 'email', data.email )
|
db.writeDataSimple( 'admin', 'email', data.email, data ).then( resp => {
|
||||||
|
resolve( resp );
|
||||||
|
} ).catch( error => {
|
||||||
|
reject( { 'code': 500, 'error': error } );
|
||||||
|
} );
|
||||||
} else if ( call === 'updateAdminAccount' ) {
|
} else if ( call === 'updateAdminAccount' ) {
|
||||||
// TODO: Finish
|
db.writeDataSimple( 'admin', 'email', data.email, data ).then( resp => {
|
||||||
|
resolve( resp );
|
||||||
|
} ).catch( error => {
|
||||||
|
reject( { 'code': 500, 'error': error } );
|
||||||
|
} );
|
||||||
} else if ( call === 'deleteAdminAccount' ) {
|
} else if ( call === 'deleteAdminAccount' ) {
|
||||||
// TODO: Finish
|
db.deleteDataSimple( 'admin', 'email', data.email ).then( resp => {
|
||||||
|
resolve( resp );
|
||||||
|
} ).catch( error => {
|
||||||
|
reject( { 'code': 500, 'error': error } );
|
||||||
|
} );
|
||||||
} else if ( call === 'updateSettings' ) {
|
} else if ( call === 'updateSettings' ) {
|
||||||
this.settings[ 'twoFA' ] = data.twoFA;
|
this.settings[ 'twoFA' ] = data.twoFA;
|
||||||
this.settings[ 'currency' ] = data.currency;
|
this.settings[ 'currency' ] = data.currency;
|
||||||
|
|||||||
@@ -132,7 +132,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Auto save every 60s (60K ms)
|
// Auto save every 60s (60K ms)
|
||||||
this.autoSave = setInterval( this.saveDraft(), 60000 );
|
this.autoSave = setInterval( () => {
|
||||||
|
const options = {
|
||||||
|
method: 'post',
|
||||||
|
body: JSON.stringify( { 'data':{ 'seatInfo': this.seatCountInfo, 'data': this.scaleDown( this.draggables ) }, 'location': sessionStorage.getItem( 'locationID' ) } ),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'charset': 'utf-8'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fetch( localStorage.getItem( 'url' ) + '/admin/api/saveSeatplanDraft', options );
|
||||||
|
}, 60000 );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Calculate scale factor (this adds support for differently sized screens)
|
Calculate scale factor (this adds support for differently sized screens)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h2>Seat Plan Editor</h2>
|
<h2>Seat Plan Editor ({{ location }})</h2>
|
||||||
<window />
|
<window />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
import window from '@/components/seatplan/editor/window.vue';
|
import window from '@/components/seatplan/editor/window.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
location: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
window,
|
window,
|
||||||
},
|
},
|
||||||
@@ -26,6 +31,7 @@
|
|||||||
if ( !sessionStorage.getItem( 'locationID' ) ) {
|
if ( !sessionStorage.getItem( 'locationID' ) ) {
|
||||||
this.$router.push( '/admin/locations' );
|
this.$router.push( '/admin/locations' );
|
||||||
}
|
}
|
||||||
|
this.location = sessionStorage.getItem( 'locationID' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user