Compare commits
2 Commits
b45a28156c
...
6445567840
Author | SHA1 | Date |
---|---|---|
Asaf Gartner | 6445567840 | |
Asaf Gartner | 9faba4270c |
|
@ -163,7 +163,7 @@ func addProjectTagCommand(projectCommand *cobra.Command) {
|
||||||
conn := db.NewConnPool(1, 1)
|
conn := db.NewConnPool(1, 1)
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
resultTag, err := hmndata.SetProjectTag(ctx, conn, projectID, tag)
|
resultTag, err := hmndata.SetProjectTag(ctx, conn, nil, projectID, tag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -449,6 +449,7 @@ func UrlContextForProject(p *models.Project) *hmnurl.UrlContext {
|
||||||
func SetProjectTag(
|
func SetProjectTag(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
dbConn db.ConnOrTx,
|
dbConn db.ConnOrTx,
|
||||||
|
currentUser *models.User,
|
||||||
projectID int,
|
projectID int,
|
||||||
tagText string,
|
tagText string,
|
||||||
) (*models.Tag, error) {
|
) (*models.Tag, error) {
|
||||||
|
@ -458,7 +459,7 @@ func SetProjectTag(
|
||||||
}
|
}
|
||||||
defer tx.Rollback(ctx)
|
defer tx.Rollback(ctx)
|
||||||
|
|
||||||
p, err := FetchProject(ctx, tx, nil, projectID, ProjectsQuery{
|
p, err := FetchProject(ctx, tx, currentUser, projectID, ProjectsQuery{
|
||||||
Lifecycles: models.AllProjectLifecycles,
|
Lifecycles: models.AllProjectLifecycles,
|
||||||
IncludeHidden: true,
|
IncludeHidden: true,
|
||||||
})
|
})
|
||||||
|
|
|
@ -760,7 +760,7 @@ func updateProject(ctx context.Context, tx pgx.Tx, user *models.User, payload *P
|
||||||
return oops.New(err, "Failed to update project")
|
return oops.New(err, "Failed to update project")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = hmndata.SetProjectTag(ctx, tx, payload.ProjectID, payload.Tag)
|
_, err = hmndata.SetProjectTag(ctx, tx, user, payload.ProjectID, payload.Tag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue