libfic: add functions to wipe {files,hints,keys}
This commit is contained in:
parent
3713659930
commit
2c25d917b3
3 changed files with 30 additions and 0 deletions
|
|
@ -185,6 +185,16 @@ func (f EFile) Delete() (int64, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (e Exercice) WipeFiles() (int64, error) {
|
||||
if res, err := DBExec("DELETE FROM exercice_files WHERE id_exercice = ?", e.Id); err != nil {
|
||||
return 0, err
|
||||
} else if nb, err := res.RowsAffected(); err != nil {
|
||||
return 0, err
|
||||
} else {
|
||||
return nb, err
|
||||
}
|
||||
}
|
||||
|
||||
func (f EFile) GetOrigin() string {
|
||||
return f.origin
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue