fixup: insert task without finished at
This commit is contained in:
parent
2702cfd049
commit
45672c2964
1 changed files with 4 additions and 1 deletions
|
@ -122,7 +122,7 @@ impl Repository for SqliteRepo {
|
|||
.conn
|
||||
.prepare(
|
||||
"INSERT INTO tasks (name, project, link, dir_path, created_at, finished_at)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?5)",
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?6)",
|
||||
)
|
||||
.map_err(|_| Error::PrepareQuery)?;
|
||||
|
||||
|
@ -134,6 +134,9 @@ impl Repository for SqliteRepo {
|
|||
&insert_data
|
||||
.dir_path
|
||||
.and_then(|p| p.into_os_string().into_string().ok()),
|
||||
&insert_data
|
||||
.finished_at
|
||||
.unwrap_or_else(|| time::OffsetDateTime::now_utc()),
|
||||
&insert_data.finished_at,
|
||||
))
|
||||
.map_err(|_| Error::InsertData)?;
|
||||
|
|
Loading…
Reference in a new issue