fixed #70 + made db script ignore double bookings
Some checks failed
Tests / Run Go Tests (push) Failing after 2m0s
Some checks failed
Tests / Run Go Tests (push) Failing after 2m0s
This commit is contained in:
@@ -128,6 +128,9 @@ func (b *Booking) InsertWithTimestamp() error {
|
||||
if b.Timestamp.IsZero() {
|
||||
return b.Insert()
|
||||
}
|
||||
if !checkLastBooking(*b) {
|
||||
return SameBookingError{}
|
||||
}
|
||||
stmt, err := DB.Prepare((`INSERT INTO anwesenheit (card_uid, geraet_id, check_in_out, anwesenheit_typ, timestamp) VALUES ($1, $2, $3, $4, $5) RETURNING counter_id`))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user