Skip to content

Commit

Permalink
[TEMP]: remove deployment limit
Browse files Browse the repository at this point in the history
  • Loading branch information
inciner8r committed Feb 26, 2024
1 parent e2ac316 commit 75b3418
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions api/v1/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ func Deploy(c *gin.Context) {
walletAddress := c.GetString(paseto.CTX_WALLET_ADDRES)
fmt.Println(walletAddress)

var count int64
err := db.Model(&models.Sotreus{}).Where("wallet_address = ?", walletAddress).Find(&models.Sotreus{}).Count(&count).Error
if err != nil {
logwrapper.Errorf("failed to fetch data from database: %s", err)
httpo.NewErrorResponse(http.StatusInternalServerError, err.Error()).SendD(c)
return
}
if count >= 1 {
logwrapper.Error("Can't create more vpn instances, maximum 1 allowed")
httpo.NewErrorResponse(http.StatusBadRequest, "Can't create more vpn instances, maximum 1 allowed").SendD(c)
return
}
// var count int64
// err := db.Model(&models.Sotreus{}).Where("wallet_address = ?", walletAddress).Find(&models.Sotreus{}).Count(&count).Error
// if err != nil {
// logwrapper.Errorf("failed to fetch data from database: %s", err)
// httpo.NewErrorResponse(http.StatusInternalServerError, err.Error()).SendD(c)
// return
// }
// if count >= 1 {
// logwrapper.Error("Can't create more vpn instances, maximum 1 allowed")
// httpo.NewErrorResponse(http.StatusBadRequest, "Can't create more vpn instances, maximum 1 allowed").SendD(c)
// return
// }

var req DeployRequest
err = c.BindJSON(&req)
err := c.BindJSON(&req)
if err != nil {
logwrapper.Errorf("failed to bind JSON: %s", err)
httpo.NewErrorResponse(http.StatusInternalServerError, err.Error()).SendD(c)
Expand Down

0 comments on commit 75b3418

Please sign in to comment.