Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static App の URL がアップデートできなかったバグを修正 #984

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions dashboard/src/features/application/schema/websiteSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ export const createWebsiteSchema = v.pipe(
pathPrefix: v.string(),
stripPrefix: v.boolean(),
https: stringBooleanSchema,
h2c: v.boolean(),
httpPort: v.pipe(v.number(), v.integer()),
// Static App ではフォームに表示されないので undefined になってしまう
// そのままだと invalid になって設定を変更できないのでデフォルト値を設定する
h2c: v.pipe(
v.optional(v.boolean()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レビュータイミング逃しちゃった ごめん 🙇
v.optional()の第二引数でデフォルト値を指定できる( https://valibot.dev/api/optional/ )のでv.optional(v.boolean(), false)って書けるかもです

v.transform((input) => input ?? false),
),
// httpPort: v.pipe(v.number(), v.integer()),
httpPort: v.pipe(
v.optional(v.number()),
v.transform((input) => input ?? 80),
v.integer(),
),
authentication: authenticationSchema,
}),
// wildcard domainが選択されている場合サブドメインは空であってはならない
Expand Down
Loading