From 62bd43c35728a7062ab850708090d1259102e776 Mon Sep 17 00:00:00 2001 From: Emile Date: Sun, 20 Oct 2019 02:19:18 +0200 Subject: delete challenge function --- src/db.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/db.go') diff --git a/src/db.go b/src/db.go index 884a365..0c2e04b 100644 --- a/src/db.go +++ b/src/db.go @@ -120,3 +120,11 @@ func dbGetChallengeByUUID(uuid string) (Challenge, error) { } return challenge, nil } + +func dbDeleteChallengeByUUID(uuid string) error { + query := fmt.Sprintf("DELETE FROM challenges WHERE uuid::text = '%s'", uuid) + + _, _ = db.Exec(query) + + return nil +} -- cgit 1.4.1