Con2 230 admin items input validation and new endpoint #327
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.
This pull request introduces a refactor and enhancement to the admin item management workflow, focusing on improved filtering, ordering, and validation for organization-specific item lists. The changes streamline how admins fetch and manage items, add more robust validation to item updates, and improve the user interface for searching and editing items.
API and Redux enhancements
getAllAdminItems
and refactoredgetOrderedItems
initemsApi
to support advanced filtering, ordering, and organization-specific queries for admin users. This enables more granular control over item lists, including filters for tags, activity, location, categories, and availability.fetchAllAdminItems
async thunk initemsSlice
, which fetches ordered and filtered items for the active organization, replacing the previous generic ordered fetch for admin contexts.fetchAllAdminItems
actions, ensuring proper loading states and error handling for admin-specific item fetches.UI/UX improvements
AdminItemsTable.tsx
) to use the newfetchAllAdminItems
selector and improved the search input with icons and clear functionality for better usability. [1] [2]UpdateItemForm.tsx
) with centralized validation logic, ensuring form data is validated before progressing to image edits or saving changes. The form now resets when toggling edit mode and provides clearer feedback flows. [1] [2] [3]Code and workflow simplification
ItemDetailsPage.tsx
) to streamline edit/cancel logic, move the delete button for clarity, and simplify the parent-child state management for editing items. [1] [2]These changes collectively improve the admin experience for managing storage items, making workflows more intuitive and robust.