Fixed duplicate created entry
Signed-off-by: Arzumify <jliwin98@danwin1210.de>
This commit is contained in:
parent
58838f51ad
commit
f4ee272865
|
@ -628,7 +628,7 @@ func Main(information library.ServiceInitializationInformation) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = conn.DB.Exec("INSERT INTO users (id, created, username, publicKey, created) VALUES ($1, $2, $3, $4, $5)", userID, time.Now().Unix(), data.Username, publicKey, time.Now().Unix())
|
_, err = conn.DB.Exec("INSERT INTO users (id, created, username, publicKey) VALUES ($1, $2, $3, $4)", userID, time.Now().Unix(), data.Username, publicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "UNIQUE constraint failed") {
|
if strings.Contains(err.Error(), "UNIQUE constraint failed") {
|
||||||
renderJSON(409, w, map[string]interface{}{"error": "Username already taken"}, information)
|
renderJSON(409, w, map[string]interface{}{"error": "Username already taken"}, information)
|
||||||
|
|
Loading…
Reference in New Issue