task can be added
This commit is contained in:
parent
87e66f74bd
commit
f73f862bcf
4 changed files with 64 additions and 15 deletions
|
@ -34,6 +34,17 @@ func (db *Database) GetAllTasks() []Task {
|
|||
return tasks
|
||||
}
|
||||
|
||||
func (db *Database) CreateTask(username string, description string) Task {
|
||||
task := Task{
|
||||
ID: 0,
|
||||
Username: username,
|
||||
Description: description,
|
||||
Done: false,
|
||||
}
|
||||
db.ORM.Create(&task)
|
||||
return task
|
||||
}
|
||||
|
||||
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