From d673dce6fa10e9d579bb18cec5fe571143b5523d Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 9 Nov 2024 12:53:53 +0000 Subject: [PATCH] fix: handle the just in case the user alrady exists as a different person --- src/commands/link_email.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/link_email.rs b/src/commands/link_email.rs index daa847c..ace4691 100644 --- a/src/commands/link_email.rs +++ b/src/commands/link_email.rs @@ -305,7 +305,8 @@ pub mod link { sqlx::query_as::<_, Wolves>( " INSERT INTO wolves (id_wolves, email) - VALUES (?1, ?2) + VALUES ($1, $2) + ON CONFLICT(id_wolves) DO UPDATE SET email = $2 ", ) .bind(id_wolves)