add datamodel ; check if zipcode is participating
This commit is contained in:
@@ -122,7 +122,10 @@ func Instance(cfg *config.Config) (contract.DataManager, error) {
|
||||
instance.profile = newProfileRepo(db)
|
||||
instance.organization = newOrganizationRepo(db)
|
||||
instance.zipcodes = newZipcodeRepo(db)
|
||||
<<<<<<< HEAD
|
||||
instance.plan = newPlanRepo(db)
|
||||
=======
|
||||
>>>>>>> add datamodel ; check if zipcode is participating
|
||||
})
|
||||
|
||||
return instance, connErr
|
||||
|
||||
@@ -62,4 +62,4 @@ func (c *zipcodeRepo) GetAll() ([]entity.Zipcode, error) {
|
||||
|
||||
func (c *zipcodeRepo) GetByParticipatingZipcode(zipcode string) (entity.Zipcode, error) {
|
||||
return c.parseEntity(c.conn.QueryRow(c.getQuery()+"WHERE a.participating = 1 AND a.zipcode = ?", zipcode))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,6 @@ func (c *controller) handleGetPortal(ctx echo.Context) error {
|
||||
}
|
||||
|
||||
func (c *controller) handleMember(ctx echo.Context) error {
|
||||
fmt.Println("\n\nHandle member\n\n")
|
||||
var user viewmodel.User
|
||||
if err := ctx.Bind(&user); err != nil {
|
||||
return routeutils.HandleAPIError(ctx, err)
|
||||
@@ -502,8 +501,6 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
//Get ZIP code and check if it is participating
|
||||
|
||||
user, err = c.svc.Users.Create(user, authUser)
|
||||
if err != nil {
|
||||
return routeutils.HandleAPIError(ctx, err)
|
||||
|
||||
Reference in New Issue
Block a user