summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2024-05-17 20:22:23 +0200
committerJulian T <julian@jtle.dk>2024-05-17 20:22:23 +0200
commit829cbaf2d0fe95abc9c65b1e34e209fc32952805 (patch)
tree3a35d6e768b09ea91540eb2f3f7b2df5bb507841 /src/model
parent22c8553af68c6f5b2c62ba790e06b249ac82ed2a (diff)
Stuff i dont remember, sorry
Diffstat (limited to 'src/model')
-rw-r--r--src/model/task.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/model/task.rs b/src/model/task.rs
index 4fdfd88..e90dd8e 100644
--- a/src/model/task.rs
+++ b/src/model/task.rs
@@ -1,15 +1,20 @@
-use std::fmt::{self, Display};
-
use sqlx::FromRow;
#[derive(Debug, FromRow)]
pub struct Task {
- pub test: String,
+ pub id: i64,
+ pub group_id: i64,
+ pub name: String,
+ pub description: String,
}
-impl Display for Task {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "test: {}", self.test)
+impl Task {
+ pub fn new(id: i64, group_id: i64, name: &str, description: &str) -> Task {
+ Task {
+ id, group_id,
+ name: String::from(name),
+ description: String::from(description),
+ }
}
}