fix(ui): resolve Zod schema parsing issue on domain transfer #1688
+4
−1
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.
What does this PR do?
Fixes #1674.
Root Cause
Domain Zod schema is parsing a Prisma update response that don't have a required field:
registeredDomain
(it can be null, but not undefined). And it does that after updating the DB and adding a record to QStash, thus returning an error but proceeding to complete the transfer (eventually sending a success email).This issue seems to be common for both verified and unverified domains.
Fix
For consistency with other domain operations like delete, I kept the Prisma response parsing and included
registeredDomain
entity into the response using Prisma'sinclude
option.Also, this PR fixes a typo in the domain transfer error message. Looks like it was copied from the domain delete API route.
How to test?
Settings > Domains