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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine as builder
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ interface CreateBucketDialogProps {
|
||||
|
||||
interface FormData {
|
||||
bucketName: string;
|
||||
createUser?: boolean;
|
||||
createUser: boolean;
|
||||
username?: string;
|
||||
password?: string;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ const schema = yup.object({
|
||||
)
|
||||
.min(3, 'Minimum 3 characters')
|
||||
.max(63, 'Maximum 63 characters'),
|
||||
createUser: yup.boolean().default(true),
|
||||
createUser: yup.boolean().defined().default(true),
|
||||
username: yup
|
||||
.string()
|
||||
.when('createUser', {
|
||||
@@ -64,6 +64,7 @@ const schema = yup.object({
|
||||
)
|
||||
.min(3, 'Minimum 3 characters')
|
||||
.max(32, 'Maximum 32 characters'),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
}),
|
||||
password: yup
|
||||
.string()
|
||||
@@ -77,6 +78,7 @@ const schema = yup.object({
|
||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,
|
||||
'Password must contain uppercase, lowercase, and number'
|
||||
),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user