feat: logs api now also returns id
This commit is contained in:
parent
7b59277931
commit
210508f1ee
6 changed files with 19 additions and 13 deletions
|
|
@ -79,10 +79,14 @@ pub fn (db &VieterDb) get_build_log(id int) ?BuildLog {
|
|||
}
|
||||
|
||||
// add_build_log inserts the given BuildLog into the database.
|
||||
pub fn (db &VieterDb) add_build_log(log BuildLog) {
|
||||
pub fn (db &VieterDb) add_build_log(log BuildLog) int {
|
||||
sql db.conn {
|
||||
insert log into BuildLog
|
||||
}
|
||||
|
||||
inserted_id := db.conn.last_id() as int
|
||||
|
||||
return inserted_id
|
||||
}
|
||||
|
||||
// delete_build_log delete the BuildLog with the given ID from the database.
|
||||
|
|
|
|||
Reference in a new issue