feat: add create and edit contract form components and fix authentication bugs (EN-267)
Summary
Create the main component for create and edit contract form and fix several important bugs related to application details and authentication
Changes
- add
@date-io/moment
library for MaterialUI date picker andreact-number-format
to handle loan amount input - add layout, form handle change and validation for create and edit contract form
- add unit tests for the component
- add API call in
ApplicationDetails
to get the application info which will be used in the cards (for now, main purpose is to pass needed id variables to create and edit contract form) - make changes to the application info model to not shorten properties' names
- recover missing code created by Sarah for the skeleton page and submit buttons for this form
- connect the submit button ("Save and Create Contract") in application layout (created by Sarah), to the form by using
ref
- fix bugs related to authentication:
- mismatch API endpoint for
refresh-tokens
(wasrefresh
before) - add proper authentication steps based on backend changes: add access token variable separately (there was only refresh token) which produce incorrect behaviors
- incorrect property get from API response of refresh token (
res.data.tokens.refresh.token
notres.data.refresh.token
)
- mismatch API endpoint for
- remove unnecessary tokens passed into child components (
AdminHomePage
andLogin
) ofApps.tsx
. Instead, use localStorage to get them from child components