Bugfix database creation

This commit is contained in:
2024-11-12 05:09:54 +01:00
parent af26e64ad8
commit 860432ead3
6 changed files with 30 additions and 20 deletions

View File

@@ -148,8 +148,6 @@ export async function prepopulateDatabase() {
capacity++ capacity++
} }
await Seat.bulkCreate(seats)
}) })
} }
else else
@@ -159,20 +157,20 @@ export async function prepopulateDatabase() {
for (let row = 0; row < location.rows; row++) { for (let row = 0; row < location.rows; row++) {
seatRows.push({ seatRows.push({
row: row + 1, row: row + 1,
SeatGroupId: seatGroup.dataValues.id seatGroupId: seatGroup.dataValues.id
}) })
} }
await SeatRow.bulkCreate(seatRows) await SeatRow.bulkCreate(seatRows)
.then(seatRowRes => { .then(seatRowRes => {
for (let seatRow of seatRowRes) { for (let seatRow of seatRowRes) {
for (let col = 0; col < seatGroup.capacity / location.rows; col++) { for (let col = 0; col < seatGroup.dataValues.capacity / location.rows; col++) {
seats.push({ seats.push({
seatNr: col, seatNr: col,
seatRowId: seatRow.id seatRowId: seatRow.dataValues.id
}) })
capacity++ capacity++
} }
} }
}) })

View File

@@ -30,7 +30,7 @@ app.use('/static', express.static(path.join(__dirname, 'images')))
// Add delay for more realistic response times // Add delay for more realistic response times
app.use((req, res, next) => { app.use((req, res, next) => {
setTimeout(next, Math.floor((Math.random () * 2000) + 100)) setTimeout(next, Math.floor((Math.random() * 1000) + 100))
}) })
// Routes // Routes

View File

@@ -120,7 +120,8 @@
"orderedAt": "Bestellt am", "orderedAt": "Bestellt am",
"noOrdersText": "Bisher wurden keine Bestellungen von diesem Account getätigt. Gehe zum Warenkorb und bestelle!", "noOrdersText": "Bisher wurden keine Bestellungen von diesem Account getätigt. Gehe zum Warenkorb und bestelle!",
"ordersDescription": "Übersicht aller getätigten Bestellungen", "ordersDescription": "Übersicht aller getätigten Bestellungen",
"order": "Bestellung | Bestellungen" "order": "Bestellung | Bestellungen",
"notShipped": "noch nicht versendet"
}, },
"basket": { "basket": {
"addToBasket": "Zum Warenkorb hinzufügen", "addToBasket": "Zum Warenkorb hinzufügen",
@@ -183,8 +184,8 @@
"bandSavedSuccessful": "Band erfolgreich gespeichert", "bandSavedSuccessful": "Band erfolgreich gespeichert",
"genreDeleteError": "Fehler beim Löschen des Genres", "genreDeleteError": "Fehler beim Löschen des Genres",
"genreDeleteSuccessful": "Genre erfolgreich gelöscht", "genreDeleteSuccessful": "Genre erfolgreich gelöscht",
"genreSavedError": "Genre erfolgreich gespeichert", "genreSavedError": "Fehler beim Speichern des Genres",
"genreSavedSuccessful": "Fehler beim Speichern des Genres" "genreSavedSuccessful": "Genre erfolgreich gespeichert"
}, },
"misc": { "misc": {
"404": { "404": {

View File

@@ -120,7 +120,8 @@
"orderedAt": "Ordered at", "orderedAt": "Ordered at",
"noOrdersText": "Bisher wurden keine Bestellungen von diesem Account getätigt. Gehe zum Warenkorb und bestelle!", "noOrdersText": "Bisher wurden keine Bestellungen von diesem Account getätigt. Gehe zum Warenkorb und bestelle!",
"ordersDescription": "Overview of all placed orders", "ordersDescription": "Overview of all placed orders",
"order": "Order | Orders" "order": "Order | Orders",
"notShipped": "don't shipped"
}, },
"basket": { "basket": {
"addToBasket": "Add to basket", "addToBasket": "Add to basket",
@@ -183,8 +184,8 @@
"bandSavedSuccessful": "Band successfully saved", "bandSavedSuccessful": "Band successfully saved",
"genreDeleteError": "Error on deleting Genre", "genreDeleteError": "Error on deleting Genre",
"genreDeleteSuccessful": "Genre successfully deleted", "genreDeleteSuccessful": "Genre successfully deleted",
"genreSavedError": "Genre successfully saved", "genreSavedError": "Error on saving genre",
"genreSavedSuccessful": "Error on saving genre" "genreSavedSuccessful": "Genre successfully saved"
}, },
"misc": { "misc": {
"404": { "404": {

View File

@@ -21,13 +21,21 @@ defineProps({
:title="title" :title="title"
:icon="icon" :icon="icon"
> >
<div class="text-h4 text-center"> <v-skeleton-loader
type="heading"
:loading="loading"
class="text-h4 d-flex justify-center"
>
{{ firstLine }} {{ firstLine }}
</div> </v-skeleton-loader>
<div class="text-h6 text-center text-disabled"> <v-skeleton-loader
type="text"
:loading="loading"
class="text-h6 text-disabled d-flex justify-center"
>
{{ secondLine }} {{ secondLine }}
</div> </v-skeleton-loader>
<template #actions> <template #actions>
<outlined-button <outlined-button

View File

@@ -110,7 +110,9 @@ orderStore.getAllOrders()
:title="$t('order.order', 2)" :title="$t('order.order', 2)"
icon="mdi-basket" icon="mdi-basket"
:first-line="orderStore.orders.length + ' ' + $t('order.order', 2)" :first-line="orderStore.orders.length + ' ' + $t('order.order', 2)"
second-line="todo" :second-line="orderStore.orders.reduce((counter, obj) => {
return !obj.shipped ? counter += 1 : counter
}, 0) + ' ' + $t('order.notShipped')"
button-route="/admin/orders" button-route="/admin/orders"
:loading="orderStore.fetchInProgress" :loading="orderStore.fetchInProgress"
/> />