fix: Resolve TypeScript type error and Docker warning

- Make createUser field required in FormData interface to match yup schema
- Add explicit optional handling for username/password in yup schema
- Fix Docker FROM casing warning (as -> AS)
- Ensure TypeScript compilation passes without errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit is contained in:
2025-07-23 13:55:01 +02:00
co-authored by Claude
parent 3bbb6b4135
commit 7ba1b8b054
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Build stage # Build stage
FROM node:20-alpine as builder FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
@@ -35,7 +35,7 @@ interface CreateBucketDialogProps {
interface FormData { interface FormData {
bucketName: string; bucketName: string;
createUser?: boolean; createUser: boolean;
username?: string; username?: string;
password?: string; password?: string;
} }
@@ -50,7 +50,7 @@ const schema = yup.object({
) )
.min(3, 'Minimum 3 characters') .min(3, 'Minimum 3 characters')
.max(63, 'Maximum 63 characters'), .max(63, 'Maximum 63 characters'),
createUser: yup.boolean().default(true), createUser: yup.boolean().defined().default(true),
username: yup username: yup
.string() .string()
.when('createUser', { .when('createUser', {
@@ -64,6 +64,7 @@ const schema = yup.object({
) )
.min(3, 'Minimum 3 characters') .min(3, 'Minimum 3 characters')
.max(32, 'Maximum 32 characters'), .max(32, 'Maximum 32 characters'),
otherwise: (schema) => schema.optional(),
}), }),
password: yup password: yup
.string() .string()
@@ -77,6 +78,7 @@ const schema = yup.object({
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/, /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,
'Password must contain uppercase, lowercase, and number' 'Password must contain uppercase, lowercase, and number'
), ),
otherwise: (schema) => schema.optional(),
}), }),
}); });