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") {
|
||||
setError(error.field, {message: error.message})
|
||||
}
|
||||
return;
|
||||
}
|
||||
toast({
|
||||
title: __("Error"),
|
||||
|
||||
@@ -361,7 +361,7 @@ func (r *mutationResolver) RequestDocumentAccess(ctx context.Context, input type
|
||||
email := input.Email
|
||||
tokenData := TokenAccessFromContext(ctx)
|
||||
if tokenData != nil {
|
||||
*email = tokenData.Email
|
||||
email = &tokenData.Email
|
||||
}
|
||||
if email == nil {
|
||||
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
|
||||
for _, disallowedVal := range disallowed {
|
||||
if reflect.DeepEqual(actualValue, disallowedVal) {
|
||||
newValidationError(
|
||||
return newValidationError(
|
||||
ErrorCodeInvalidEnum,
|
||||
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)
|
||||
valueStr := fmt.Sprint(actualValue)
|
||||
if disallowedMap[valueStr] {
|
||||
newValidationError(
|
||||
return newValidationError(
|
||||
ErrorCodeInvalidEnum,
|
||||
fmt.Sprintf("must not be one of: %s", strings.Join(disallowedStrings, ", ")),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user