Skip to content

Commit

Permalink
feat : updated brand_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
surajhub255 committed Jul 18, 2024
1 parent c2b8704 commit d7a120e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/brand_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func GetBrand(c *gin.Context) {

// get all brands api
func GetAllBrands(c *gin.Context) {
chaintypeId := c.Param("chaintype_id")
var brands []models.Brand
chainTypeId := c.Param("chaintype_id")
if err := db.DB.Find(&brands).Where("chaintype_id = ? ", chainTypeId).Error; err != nil {
if err := db.DB.Where("chaintype_id = ?", chaintypeId).Find(&brands).Error; err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
Expand Down
2 changes: 1 addition & 1 deletion models/brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Brand struct {
TradeHub string `json:"trade_hub"`
Blockchain string `json:"blockchain"`
ChainID string `json:"chain_id"`
ChainTypeID uuid.UUID `gorm:"type:uuid" json:"chaintype_id"`
ChaintypeID uuid.UUID `gorm:"type:uuid" json:"chaintype_id"`
ManagerID string `json:"manager_id"` //user walletaddress
CreatedAt time.Time `gorm:"type:timestamp;default:current_timestamp" json:"created_at"`
UpdatedAt time.Time `gorm:"type:timestamp;default:current_timestamp" json:"updated_at"`
Expand Down

0 comments on commit d7a120e

Please sign in to comment.