Skip to content

Commit 2ff0bc2

Browse files
committed
Fixed bug when accepting a new serial
1 parent f955976 commit 2ff0bc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/org/vzbot/discord/components/AcceptSerialRequestButton.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ class AcceptSerialRequestButton: PermanentDiscordButton("vz_accept_serial", Disc
5353
}
5454

5555
val confirmModal = ConfirmModal("Accept this application?") { sender, _, _ ->
56+
57+
val serialCount = transaction { SerialNumber.count() }
58+
5659
val serialNumber = transaction {
5760
SerialNumber.new {
61+
this.serialID = serialCount + 1
5862
this.description = ticket.description
5963
this.country = ticket.country
6064
this.printer = ticket.printer
@@ -82,7 +86,7 @@ class AcceptSerialRequestButton: PermanentDiscordButton("vz_accept_serial", Disc
8286

8387
val channel = actionSender.textChannel
8488

85-
val serialID = transaction { serialNumber.id.value }
89+
val serialID = transaction { serialNumber.serialID }
8690

8791
val embed = prettyEmbed("Application Accepted", "**Congratulations**. Your application has been accepted and you have been granted your new serial id. In the following messages, we will send you the files to print your serial badge. Welcome to the **VZParty!** Feel free to delete your ticket, when you have grabbed your filed.", Color.GREEN)
8892
embed.addField("Serial ID", serialID.toString(), false)

0 commit comments

Comments
 (0)