This is a Next.js project that uses Typescript, and Hasura.
- Clone the repo locally.
- Install all necessary packages by running
yarn
- Run
yarn dev
to get your dev environment up and running
Open http://localhost:3000 with your browser to see the result.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
Technical Assignment Task:
Objective: Fix the bugs related to updating the datatable after adding a new target through a modal and the duplication of data when clicking the sync target button.
Steps to follow:
- Fork the repository from the original repository.
- Clone the forked repository to your local machine.
- Set up the development environment if necessary.
- Analyze the codebase to identify the cause of the bugs.
- Make necessary changes to fix the bugs while minimizing changes that may impact existing functionality.
- Test the modified code to ensure that the bugs are resolved and there are no regressions.
- Commit the changes to your forked repository, providing meaningful commit messages.
- Push the changes to your forked repository.
- Share the link to your forked repository with the hiring team for validation.
Bug 1: DataTable not updating after adding a new target through modal:
- Analyze the code related to adding new targets and updating the DataTable.
- Identify any missing or incorrect logic that prevents the DataTable from being updated.
- Make the necessary changes to ensure that the DataTable is updated with the new data after adding a target through the modal.
- Test the functionality thoroughly to confirm that the DataTable is correctly updated.
Bug 2: Duplication of data when clicking the sync target button:
- Review the code associated with the sync target button functionality.
- Identify the reason behind the duplication of data when the button is clicked.
- Modify the code to prevent data duplication while maintaining the desired synchronization functionality.
- Test the synchronization process to verify that the duplication issue is resolved.
Additional guidelines:
- Ensure that your changes follow the existing coding style and conventions used in the codebase.
- Document any significant changes or assumptions made during the bug fixing process.
- Feel free to refactor or optimize the codebase where necessary, but be cautious not to introduce new bugs.
- Test the application thoroughly after making changes to ensure that all functionalities are working as expected.
- Provide a detailed README file that includes instructions for setting up the project, running the application, and any other relevant information.
Please note that the provided video link should be reviewed to gain a better understanding of the bugs and their context. https://youtu.be/sOKjmCSrPI8 https://youtu.be/1FC2kM2nNXw
Get your NEXT_PUBLIC_ACCESS_TOKEN by following this instruction
curl -X GET \
-H "Cookie: appSession=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0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EfAK8ZAa_WXVeQkQfJvqu7yETQr6L1Rg1G2ZqkEwK7VOgWP6n-IpzwqZ0DebT17sbQ7uugInrZ0plRJMu_z1stFhSSCQ2-cr06fUDAKULiP2u6hg9-O2bJlMJJw4ttaSmllUayNMCjzhZrrrJ9xsKEpiZXxBx_Ef8x4suD9SGdRzk4cIQgf19Wnmq2qQk_Pfwk_4Lyjk3CmKDaDxouiBT4sJDwk6_j2eVHUVnr_RywS90NjuGdVoBy8UEX857762O-Zw0S2WiZ7fURw3N98W1RgEmFq-nkzGwJd5_YWTYgiREEPYMFF7fQgbGDSHKgfhciZSOZeSyptwBL3S8_M5YXrdLAhYH3mvqkRpnwF4_Wtz4XsIXHAldxHdElwJN8Sz5DZV-jkrpKbtAtYFWnDvzhAztCQFm9uv0B8F3LKNVQAw1VbjuAjiMwJOTvycTzsRRNCG6Hawj9lSU3xatbZblgKpuXw-whqnpSLnqYiAbWumJtqW17zI7UQDpAQICcfFyT8907AE6C5s_2I4GN0bijqF1HNOcvVZkt2C4KXoekJgDreGtQTsfQRk1hu7627xNAGb_vwfAWYvhx9s475DnUySTqhmSIJcwM_go2RDXgyZQAgxQQL7iVWmGGxE2810IC2ej0UpRjb7qGe9jbkbvksRjAA01dehfBQZ4Teo2Ax8Ff1yU.W-1ebP-3Jfgh3PiPMiAHCQ" \
https://66cca8f1fe77df.lhr.life/api/session
- Copy token value and paste it to NEXT_PUBLIC_ACCESS_TOKEN
- If issue persist please reachout to my email.