Fix missing return statements
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -67,6 +67,7 @@ export function RequestAccessDialog({
|
|||||||
if (error.field === "email") {
|
if (error.field === "email") {
|
||||||
setError(error.field, {message: error.message})
|
setError(error.field, {message: error.message})
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
toast({
|
toast({
|
||||||
title: __("Error"),
|
title: __("Error"),
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ func (r *mutationResolver) RequestDocumentAccess(ctx context.Context, input type
|
|||||||
email := input.Email
|
email := input.Email
|
||||||
tokenData := TokenAccessFromContext(ctx)
|
tokenData := TokenAccessFromContext(ctx)
|
||||||
if tokenData != nil {
|
if tokenData != nil {
|
||||||
*email = tokenData.Email
|
email = &tokenData.Email
|
||||||
}
|
}
|
||||||
if email == nil {
|
if email == nil {
|
||||||
return nil, fmt.Errorf("email is required for unauthenticated users")
|
return nil, fmt.Errorf("email is required for unauthenticated users")
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ func NotOneOfSlice[T any](disallowed []T) ValidatorFunc {
|
|||||||
// First try exact match with DeepEqual
|
// First try exact match with DeepEqual
|
||||||
for _, disallowedVal := range disallowed {
|
for _, disallowedVal := range disallowed {
|
||||||
if reflect.DeepEqual(actualValue, disallowedVal) {
|
if reflect.DeepEqual(actualValue, disallowedVal) {
|
||||||
newValidationError(
|
return newValidationError(
|
||||||
ErrorCodeInvalidEnum,
|
ErrorCodeInvalidEnum,
|
||||||
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
|
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
|
||||||
)
|
)
|
||||||
@@ -268,7 +268,7 @@ func NotOneOfSlice[T any](disallowed []T) ValidatorFunc {
|
|||||||
// Then try string comparison (for custom string types)
|
// Then try string comparison (for custom string types)
|
||||||
valueStr := fmt.Sprint(actualValue)
|
valueStr := fmt.Sprint(actualValue)
|
||||||
if disallowedMap[valueStr] {
|
if disallowedMap[valueStr] {
|
||||||
newValidationError(
|
return newValidationError(
|
||||||
ErrorCodeInvalidEnum,
|
ErrorCodeInvalidEnum,
|
||||||
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
|
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user