Skip to content

Commit

Permalink
chore: add contest to problem_model
Browse files Browse the repository at this point in the history
  • Loading branch information
K0nnyaku committed Dec 4, 2024
1 parent 81269bf commit 40748b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/models/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ pub struct Problem {
pub categories: Vec<String>,
pub tags: Vec<String>,

pub contest: Option<Thing>,

pub visibility: ProblemVisibility,

pub created_at: chrono::NaiveDateTime,
Expand Down Expand Up @@ -89,6 +91,8 @@ pub struct CreateProblem<'r> {
pub categories: Vec<String>,
pub tags: Vec<String>,

pub contest: Option<Thing>,

pub visibility: ProblemVisibility,
}

Expand All @@ -110,6 +114,7 @@ impl From<CreateProblem<'_>> for Problem {
categories: val.categories,
tags: val.tags,
visibility: val.visibility,
contest: None,
created_at: chrono::Local::now().naive_local(),
updated_at: chrono::Local::now().naive_local(),
}
Expand Down

0 comments on commit 40748b6

Please sign in to comment.