Skip to content
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

refactor: change post/patch folders requests to use UseQuery #2917

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

Cristhianzl
Copy link
Collaborator

This pull request will change post/patch Folder's requests to use useQuery.

…lders in the sidebar

📝 (folders): Add use-post-folders and use-patch-folders hooks for handling post and patch requests for folders
🔧 (BundleModal): Remove useFolderSubmit hook and directly use usePostFolders hook for adding and updating folders in the modal
…ng of the component

📝 (folders/index.tsx): Export use-delete-folders from the folders index file
📝 (use-delete-folders.ts): Create useDeleteFolders hook to handle deletion of folders
🔧 (use-delete-folder.tsx): Remove unused useDeleteFolder hook
📝 (mainPage/index.tsx): Replace useDeleteFolder hook with useDeleteFolders hook to handle folder deletion
…ders in the sidebar component

🔧 (use-patch-folders): Refactor IPatchAddFolders interface to IPatchPatchFolders for better naming consistency
🔧 (use-patch-folders): Refactor addFoldersFn to patchFoldersFn for better function naming
🔧 (use-patch-folders): Update patchFoldersFn to send patch request to specific folder endpoint
🔧 (use-patch-folders): Update patchFoldersFn to handle updating folders and return updated data
🔧 (use-patch-folders): Update usePatchFolders hook to use patchFoldersFn for mutation
🔧 (use-post-folders): Remove unnecessary call to getFoldersApi after posting folders
🔧 (BundleModal): Remove BundleModal component and entities as they are no longer needed

🔧 (BundleModal/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/component/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/entities/index.ts): Remove unused zod schema and clean up code
🔧 (foldersModal/hooks/submit-folder.tsx): Remove unused imports and clean up code

✨ (foldersModal/index.tsx): Remove unused FoldersModal component from modalsComponent to optimize code and improve maintainability.
…rops from ModalsComponent

♻️ (services/index.ts): Remove addFolder, updateFolder, and deleteFolder functions as they are not used in the application
♻️ (foldersStore.tsx): Remove unused import statements for uploadFlowsFromFolders from services and related functions
@Cristhianzl Cristhianzl self-assigned this Jul 24, 2024
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 24, 2024
Copy link
Contributor

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has mentioned issues
Pull request has valid branch name
Pull request should have a non-empty body

Result

Pull request satisfies all enabled pull request rules.

Last Modified at 24 Jul 24 13:57 UTC

@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Jul 24, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2917.dmtpw4p5recq1.amplifyapp.com

Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 24, 2024
@Cristhianzl Cristhianzl enabled auto-merge (squash) July 24, 2024 18:46
@Cristhianzl Cristhianzl merged commit 6c5b487 into main Jul 24, 2024
30 checks passed
@Cristhianzl Cristhianzl deleted the refactor/postPatchFolders branch July 24, 2024 18:57
nicoloboschi pushed a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 30, 2024
…w-ai#2917)

* ✨ (sidebarComponent): Add usePostFolders hook to handle adding new folders in the sidebar
📝 (folders): Add use-post-folders and use-patch-folders hooks for handling post and patch requests for folders
🔧 (BundleModal): Remove useFolderSubmit hook and directly use usePostFolders hook for adding and updating folders in the modal

* ✨ (sidebarComponent): Add usePatchFolders hook to handle updating folders in the sidebar component
🔧 (use-patch-folders): Refactor IPatchAddFolders interface to IPatchPatchFolders for better naming consistency
🔧 (use-patch-folders): Refactor addFoldersFn to patchFoldersFn for better function naming
🔧 (use-patch-folders): Update patchFoldersFn to send patch request to specific folder endpoint
🔧 (use-patch-folders): Update patchFoldersFn to handle updating folders and return updated data
🔧 (use-patch-folders): Update usePatchFolders hook to use patchFoldersFn for mutation
🔧 (use-post-folders): Remove unnecessary call to getFoldersApi after posting folders
🔧 (BundleModal): Remove BundleModal component and entities as they are no longer needed

🔧 (BundleModal/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/component/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/entities/index.ts): Remove unused zod schema and clean up code
🔧 (foldersModal/hooks/submit-folder.tsx): Remove unused imports and clean up code

✨ (foldersModal/index.tsx): Remove unused FoldersModal component from modalsComponent to optimize code and improve maintainability.

* 📝 (index.tsx): Remove unused openFolderModal and setOpenFolderModal props from ModalsComponent
♻️ (services/index.ts): Remove addFolder, updateFolder, and deleteFolder functions as they are not used in the application
♻️ (foldersStore.tsx): Remove unused import statements for uploadFlowsFromFolders from services and related functions

* 📝 (index.tsx): replace async/await with synchronous function call to refresh folders after successful operation

(cherry picked from commit 6c5b487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants