about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-20 02:19:18 +0200
committerEmile <hanemile@protonmail.com>2019-10-20 02:19:18 +0200
commit62bd43c35728a7062ab850708090d1259102e776 (patch)
tree4837e44a1e664b977275ec68f8cebd2a88caccf4 /src
parentb6da5353343128fb2f15562ff5125584ba05ed84 (diff)
delete challenge function
Diffstat (limited to 'src')
-rw-r--r--src/db.go8
1 files changed, 8 insertions, 0 deletions
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
+}