Diff
Logged in as anonymous

Differences From Artifact [c856c2cf77]:

To Artifact [52e93d948c]:


271
272
273
274
275
276
277
278



279
280
281
282
283
284
285
			}
			.bind(channel_id)
			.bind(url)
			.bind(iv_hash)
			.bind(owner)
			.bind(channel)
			.execute(&mut conn).await {
			Ok(_) => return Ok(String::from("Channel added\\.")),



			Err(sqlx::Error::Database(err)) => {
				match err.downcast::<sqlx::postgres::PgDatabaseError>().routine() {
					Some("_bt_check_unique", ) => {
						return Ok("Duplicate key\\.".to_string())
					},
					Some(_) => {
						return Ok("Database error\\.".to_string())







|
>
>
>







271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
			}
			.bind(channel_id)
			.bind(url)
			.bind(iv_hash)
			.bind(owner)
			.bind(channel)
			.execute(&mut conn).await {
			Ok(_) => return Ok(String::from(match update {
				Some(_) => "Channel updated\\.",
				None => "Channel added\\.",
			})),
			Err(sqlx::Error::Database(err)) => {
				match err.downcast::<sqlx::postgres::PgDatabaseError>().routine() {
					Some("_bt_check_unique", ) => {
						return Ok("Duplicate key\\.".to_string())
					},
					Some(_) => {
						return Ok("Database error\\.".to_string())