forked from vieter-v/vieter
refactor: removed commented code & ran formatter
This commit is contained in:
parent
c818273790
commit
204144cee8
7 changed files with 17 additions and 193 deletions
20
src/db/git.v
20
src/db/git.v
|
|
@ -29,12 +29,12 @@ pub mut:
|
|||
|
||||
pub fn (gr &GitRepo) str() string {
|
||||
mut parts := [
|
||||
"id: $gr.id",
|
||||
"url: $gr.url",
|
||||
"branch: $gr.branch",
|
||||
"repo: $gr.repo",
|
||||
"schedule: $gr.schedule",
|
||||
"arch: ${gr.arch.map(it.value).join(', ')}"
|
||||
'id: $gr.id',
|
||||
'url: $gr.url',
|
||||
'branch: $gr.branch',
|
||||
'repo: $gr.repo',
|
||||
'schedule: $gr.schedule',
|
||||
'arch: ${gr.arch.map(it.value).join(', ')}',
|
||||
]
|
||||
str := parts.join('\n')
|
||||
|
||||
|
|
@ -121,18 +121,12 @@ pub fn (db &VieterDb) update_git_repo(repo_id int, params map[string]string) {
|
|||
// Any fields that are array types require their own update method
|
||||
$if field.typ is string {
|
||||
values << "$field.name = '${params[field.name]}'"
|
||||
// r.$(field.name) = params[field.name]
|
||||
// This specific type check is needed for the compiler to ensure
|
||||
// our types are correct
|
||||
}
|
||||
//$else $if field.typ is []GitRepoArch {
|
||||
// r.$(field.name) = params[field.name].split(',').map(GitRepoArch{ value: it })
|
||||
//}
|
||||
}
|
||||
}
|
||||
values_str := values.join(', ')
|
||||
query := 'update GitRepo set $values_str where id == $repo_id'
|
||||
println(query)
|
||||
|
||||
db.conn.exec_none(query)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue