feat: logs api now also returns id

This commit is contained in:
Jef Roosens 2022-09-11 20:34:02 +02:00
parent 7b59277931
commit 210508f1ee
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 19 additions and 13 deletions

View file

@ -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.