Skip to content

Commit

Permalink
update code to fulfill requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed May 14, 2024
1 parent 9a764fe commit a7e57e7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion handlers/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/go-chi/chi"
"github.com/rs/xid"
"github.com/stakwork/sphinx-tribes/auth"
"github.com/stakwork/sphinx-tribes/db"
"io"
Expand Down Expand Up @@ -111,7 +112,15 @@ func (oh *featureHandler) CreateOrEditFeaturePhase(w http.ResponseWriter, r *htt
return
}

newPhase.CreatedBy = pubKeyFromAuth
if newPhase.Uuid == "" {
newPhase.Uuid = xid.New().String()
}

if newPhase.CreatedBy != "" {
newPhase.UpdatedBy = pubKeyFromAuth
} else {
newPhase.CreatedBy = pubKeyFromAuth
}

phase, err := oh.db.CreateOrEditFeaturePhase(newPhase)
if err != nil {
Expand Down

0 comments on commit a7e57e7

Please sign in to comment.