Skip to content

Commit 179e12d

Browse files
committed
update stellarAddress json constraints
1 parent 5cae3fe commit 179e12d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node-registrar/pkg/db/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Farm struct {
2424
FarmID uint64 `gorm:"primaryKey;autoIncrement" json:"farm_id"`
2525
FarmName string `gorm:"size:40;not null;unique;check:farm_name <> ''" json:"farm_name" binding:"alphanum,required"`
2626
TwinID uint64 `json:"twin_id" gorm:"not null;check:twin_id > 0"` // Farmer account reference
27-
StellarAddress string `json:"stellar_address" binding:"max=56,startswith=G,len=56,alphanum,uppercase"`
27+
StellarAddress string `json:"stellar_address" binding:"required,startswith=G,len=56,alphanum,uppercase"`
2828
Dedicated bool `json:"dedicated"`
2929
CreatedAt time.Time `json:"created_at"`
3030
UpdatedAt time.Time `json:"updated_at"`

node-registrar/pkg/server/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (s Server) createFarmHandler(c *gin.Context) {
132132

133133
type UpdateFarmRequest struct {
134134
FarmName string `json:"farm_name" binding:"max=40"`
135-
StellarAddress string `json:"stellar_address" binding:"max=56,startswith=G,len=56,alphanum,uppercase"`
135+
StellarAddress string `json:"stellar_address" binding:"startswith=G,len=56,alphanum,uppercase"`
136136
}
137137

138138
// @Summary Update farm

0 commit comments

Comments
 (0)