endpoint to get tasks
This commit is contained in:
parent
9e058e4f03
commit
712af41c28
5 changed files with 28 additions and 3 deletions
|
@ -28,6 +28,12 @@ func (db *Database) Initialize() {
|
|||
db.ORM = orm
|
||||
}
|
||||
|
||||
func (db *Database) GetAllTasks() []Task {
|
||||
var tasks []Task
|
||||
db.ORM.Find(&tasks)
|
||||
return tasks
|
||||
}
|
||||
|
||||
func (db *Database) CreateUser(username string, password string) error {
|
||||
user := User{Username: username, Password: password}
|
||||
result := db.ORM.Create(&user)
|
||||
|
|
Reference in a new issue