Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Fix validation
Acho Arnold2bc5726337d5
diff --git a/api/pkg/di/container.go b/api/pkg/di/container.goindex 81d60051..b37de298 100644--- a/api/pkg/di/container.go+++ b/api/pkg/di/container.go@@ -60,6 +60,8 @@ func NewContainer(projectID string) (container *Container) {container.RegisterUserRoutes()+ container.RegisterPhoneRoutes()+// this has to be last since it registers the /* routecontainer.RegisterSwaggerRoutes()diff --git a/api/pkg/requests/phone_index_request.go b/api/pkg/requests/phone_index_request.goindex 4b370fc4..ff1cc8c4 100644--- a/api/pkg/requests/phone_index_request.go+++ b/api/pkg/requests/phone_index_request.go@@ -10,7 +10,6 @@ import (type PhoneIndex struct {requestSkip string `json:"skip" query:"skip"`- Owner string `json:"owner" query:"owner"`Query string `json:"query" query:"query"`Limit string `json:"limit" query:"limit"`}@@ -21,7 +20,6 @@ func (input *PhoneIndex) Sanitize() PhoneIndex {input.Limit = "1"}input.Query = strings.TrimSpace(input.Query)- input.Owner = input.sanitizeAddress(input.Owner)input.Skip = strings.TrimSpace(input.Skip)if input.Skip == "" {input.Skip = "0"diff --git a/api/pkg/validators/message_handler_validator.go b/api/pkg/validators/message_handler_validator.goindex 17d387c2..1ebcf8c6 100644--- a/api/pkg/validators/message_handler_validator.go+++ b/api/pkg/validators/message_handler_validator.go@@ -45,7 +45,6 @@ func (validator MessageHandlerValidator) ValidateMessageReceive(_ context.Contex},"from": []string{"required",- phoneNumberRule,},"content": []string{"required",@@ -57,9 +56,6 @@ func (validator MessageHandlerValidator) ValidateMessageReceive(_ context.Contex"to": {"regex: The 'to' field must be a valid E.164 phone number: https://en.wikipedia.org/wiki/E.164",},- "from": {- "regex: The 'from' field must be a valid E.164 phone number: https://en.wikipedia.org/wiki/E.164",- },},})diff --git a/api/pkg/validators/phone_handler_validator.go b/api/pkg/validators/phone_handler_validator.goindex 0c028b5d..bf346acf 100644--- a/api/pkg/validators/phone_handler_validator.go+++ b/api/pkg/validators/phone_handler_validator.go@@ -46,10 +46,6 @@ func (validator *PhoneHandlerValidator) ValidateIndex(_ context.Context, request"query": []string{"max:100",},- "owner": []string{- "required",- phoneNumberRule,- },},})return v.ValidateStruct()