This commit is contained in:
parent
99cec81d91
commit
29d2069bb1
@ -6,12 +6,11 @@ import (
|
|||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (tm *TaskManagerRepository) AddProject(newProject *project.UserProjectLink) error {
|
func (tm *TaskManagerRepository) AddProject(newProject *project.Project) error {
|
||||||
err := tm.db.QueryRow(`INSERT INTO task_manager.project(name,description)
|
err := tm.db.QueryRow(`INSERT INTO task_manager.project(name,description)
|
||||||
VALUES ($1,$2)
|
VALUES ($1,$2)
|
||||||
RETURNING id
|
RETURNING id
|
||||||
`, newProject.Name, newProject.Description).Scan(&newProject.Id)
|
`, newProject.Name, newProject.Description).Scan(&newProject.Id)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user