Memperbaiki bug formulir sunting pengguna yang tidak ada isinya, merincikan tipe data untuk formulir, dan beberapa restruktur kode #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lagi males ngetik, ini dari copilot:
This pull request includes several changes to the user data form handling, focusing on code organization, type safety, and validation improvements.
Code Organization:
src/app/(authenticated user)/data/users/(form)/[uuid]/hook.ts
: Reorganized imports by grouping them into types, vendors, functions, and database sections. (src/app/(authenticated user)/data/users/(form)/[uuid]/hook.tsL1-R31)src/app/(authenticated user)/data/users/(form)/create/hook.ts
: Reorganized imports similarly to maintain consistency.Type Safety:
src/app/(authenticated user)/data/users/(form)/[uuid]/hook.ts
: ChangeduserUuid
parameter type toUUID
for better type safety. (src/app/(authenticated user)/data/users/(form)/[uuid]/hook.tsL1-R31)src/app/(authenticated user)/data/users/(form)/[uuid]/page.tsx
: IntroducedPageProps
interface and useduseParams
to fetchuuid
. (src/app/(authenticated user)/data/users/(form)/[uuid]/page.tsxR3-R15)src/app/(authenticated user)/data/users/(form)/_types/form-values.ts
: Added a newFormValues
type to ensure form data structure consistency.Validation Improvements:
src/app/(authenticated user)/data/users/(form)/_functions/get-validated-form-values.ts
: AddedgetValidatedFormValues
function to validate and transform form values before saving.src/app/(authenticated user)/data/users/(form)/[uuid]/hook.ts
: UsedgetValidatedFormValues
to validate and transform form data before updating the user. (src/app/(authenticated user)/data/users/(form)/[uuid]/hook.tsL30-R50)src/app/(authenticated user)/data/users/(form)/create/hook.ts
: UsedgetValidatedFormValues
to validate and transform form data before creating a new user.Form Handling:
src/app/(authenticated user)/data/users/(form)/_components/form.tsx
: Improved form submission handling by preventing default form submission and handling submission viahandleSubmit
.src/app/(authenticated user)/data/users/(form)/_components/form.tsx
: Updated form field names and added validation rules forpin
andpin_confirmation
fields. [1] [2]Miscellaneous:
src/app/manifest.webmanifest
: Removed thedir
attribute to fix a manifest configuration issue.