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)
|
||||
defer conn.Close()
|
||||
|
||||
resultTag, err := hmndata.SetProjectTag(ctx, conn, projectID, tag)
|
||||
resultTag, err := hmndata.SetProjectTag(ctx, conn, nil, projectID, tag)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
@ -449,6 +449,7 @@ func UrlContextForProject(p *models.Project) *hmnurl.UrlContext {
|
|||
func SetProjectTag(
|
||||
ctx context.Context,
|
||||
dbConn db.ConnOrTx,
|
||||
currentUser *models.User,
|
||||
projectID int,
|
||||
tagText string,
|
||||
) (*models.Tag, error) {
|
||||
|
@ -458,7 +459,7 @@ func SetProjectTag(
|
|||
}
|
||||
defer tx.Rollback(ctx)
|
||||
|
||||
p, err := FetchProject(ctx, tx, nil, projectID, ProjectsQuery{
|
||||
p, err := FetchProject(ctx, tx, currentUser, projectID, ProjectsQuery{
|
||||
Lifecycles: models.AllProjectLifecycles,
|
||||
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")
|
||||
}
|
||||
|
||||
_, err = hmndata.SetProjectTag(ctx, tx, payload.ProjectID, payload.Tag)
|
||||
_, err = hmndata.SetProjectTag(ctx, tx, user, payload.ProjectID, payload.Tag)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Reference in New Issue