-
Notifications
You must be signed in to change notification settings - Fork 45
fix: loan query validation #1762
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
apps/main/src/llamalend/queries/validation/borrow-fields.validation.ts
Outdated
Show resolved
Hide resolved
apps/main/src/llamalend/queries/create-loan/create-loan-route-image.query.ts
Outdated
Show resolved
Hide resolved
|
This branch also has broken styles for the action form sub nav and the self-liquidate section but it is probably unrelated to this PR |
Thank you, that was a good point. Apparently the vest form only validates fields that change, so if the debt is changed, we need to revalidate the maxDebt and vice-versa 😞 The fix is in 987d1e0 but I'd like to add some tests
Yes I've seen this before, indeed. I fixed it in one of the follow-up PRs: |
|
Now the "debt too high" error remains after updating the "borrow" value to "max": Screen.Recording.2025-12-15.at.19.44.29.mov |
I believe you checked an outdated version, the test I introduced does exactly this and it's passing |
| * This is necessary because passing UseQueryResult to any react component will crash the rendering due to | ||
| * react trying to serialize the react-query proxy object. | ||
| */ | ||
| const q = <T,>({ data, isLoading, error }: UseQueryResult<T>): Query<T> => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Souldn't we export it and place it in some utils to be reused elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll move it as soon as it's used in the follow-up PR
| sliderProps?: SliderInputProps<Decimal>['sliderProps'] | ||
|
|
||
| /** Optional children to be rendered below the input */ | ||
| children?: ReactNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update the storybook maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I'll do that in another PR

Uh oh!
There was an error while loading. Please reload this page.