add: contactController,tests & refactored tests
This commit is contained in:
@@ -40,15 +40,17 @@ func (mc *MembershipController) RegisterSubscription(c *gin.Context) {
|
||||
c.JSON(http.StatusExpectationFailed, "API Key is missing")
|
||||
return
|
||||
}
|
||||
logger.Info.Printf("registering subscription: %+v", regData)
|
||||
|
||||
// Register Subscription
|
||||
id, err := mc.Service.RegisterSubscription(®Data.Model)
|
||||
if err != nil {
|
||||
logger.Error.Printf("Couldn't register Membershipmodel: %v", err)
|
||||
c.JSON(http.StatusInternalServerError, "Couldn't register Membershipmodel")
|
||||
c.JSON(int(id), "Couldn't register Membershipmodel")
|
||||
return
|
||||
}
|
||||
regData.Model.ID = id
|
||||
|
||||
logger.Info.Printf("registering subscription: %+v", regData)
|
||||
c.JSON(http.StatusCreated, gin.H{
|
||||
"status": "success",
|
||||
"id": id,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user