Skip to content

Commit

Permalink
Исправлена сборка после супер-пупер-мега ребейза
Browse files Browse the repository at this point in the history
  • Loading branch information
vklachkov committed Sep 25, 2024
1 parent 1ee1a6c commit 45f160b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions backend/src/datasource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ impl DataSource {
jury: Option<Adult>,
info: ParticipantInfo,
answers: HashMap<String, String>,
rates: Option<HashMap<AdultId, Option<ParticipantRate>>>
rates: Option<HashMap<AdultId, Option<ParticipantRate>>>,
) -> Result<(ParticipantId, String)> {
self.participants.create(code, jury, info, answers, rates).await
self.participants
.create(code, jury, info, answers, rates)
.await
}

pub async fn get_participant(&self, id: ParticipantId) -> Result<Option<Participant>> {
Expand Down
6 changes: 4 additions & 2 deletions backend/src/datasource/participants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Participants {
info: ParticipantInfo,
answers: HashMap<String, String>,
rates: Option<HashMap<AdultId, Option<ParticipantRate>>>,
) -> Result<()> {
) -> Result<(ParticipantId, String)> {
self.transact(move |conn| {
use schema::{
adults::{self},
Expand All @@ -35,7 +35,9 @@ impl Participants {

let (participant_id, participant_code): (i32, String) =
diesel::insert_into(participants::table)
.values(super::models::NewParticipant::new(info, answers))
.values(super::models::NewParticipant::new(
code, jury, info, answers,
))
.returning((participants::id, participants::code))
.get_result(conn)?;

Expand Down

0 comments on commit 45f160b

Please sign in to comment.