// ValidateServiceBodyAndServiceExists validates both request body and if service already exists 
ValidateServiceBodyAndServiceExists validates both request body and if service already exists
// ValidateServiceBodyAndServiceExists validates both request body and if service already exists
func ValidateServiceBodyAndServiceExists(c *routing.Context, serviceID string) (service.Service, int, error) {
	s, err := ValidateServiceBody(c)
	if err != nil {
		return service.Service{}, 400, err
	}
	if serviceID != "" {
		s.Id = bson.ObjectIdHex(serviceID)
	}
	_, err = ValidateServiceExists(s)
	if err != nil {
		return service.Service{}, 404, err
	}
	return s, 200, nil
}
func ValidateServiceBodyAndServiceExists ( c * routing . Context , serviceID string ) ( service . Service , int , error ) { s , err := ValidateServiceBody ( c ) if err != nil { return service . Service { } , 400 , err } if serviceID != " " { s . Id = bson . ObjectIdHex ( serviceID ) } _ , err = ValidateServiceExists ( s ) if err != nil { return service . Service { } , 404 , err } return s , 200 , nil }
ValidateServiceBodyAndServiceExists validates both request body and if service already exists
ValidateServiceBodyAndServiceExists validates both request body and if service already exists