Fix missing return statements

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-15 17:20:42 +01:00
parent b81ac0d01c
commit 2f8aef9927
3 changed files with 4 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ export function RequestAccessDialog({
if (error.field === "email") {
setError(error.field, {message: error.message})
}
return;
}
toast({
title: __("Error"),

View File

@@ -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")

View File

@@ -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, ", ")),
)