feat: Implement comprehensive edit functionality and standardize UI components
• Add full edit functionality for groceries with modal support
• Standardize delete confirmations across all components using ConfirmDeleteModal
• Implement complete shopping event edit functionality:
- Create EditShoppingEvent component with full form capabilities
- Add missing backend PUT endpoint for shopping events
- Support editing all event data (shop, date, groceries, amounts, prices, notes)
• Add inline grocery edit functionality in shopping event forms:
- Allow editing grocery items within add/edit forms
- Load selected items back into input fields for modification
• Fix date timezone issues in edit forms to prevent date shifting
• Remove non-functional "View Details" button in favor of working Edit button
• Enhance user experience with consistent edit/delete patterns across the app
Breaking changes: None
Backend: Added PUT /shopping-events/{id} and DELETE /shopping-events/{id} endpoints
Frontend: Complete edit workflow for all entities with improved UX
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
export interface Grocery {
|
||||
id: number;
|
||||
name: string;
|
||||
price: number;
|
||||
category: string;
|
||||
organic: boolean;
|
||||
weight?: number;
|
||||
@@ -12,7 +11,6 @@ export interface Grocery {
|
||||
|
||||
export interface GroceryCreate {
|
||||
name: string;
|
||||
price: number;
|
||||
category: string;
|
||||
organic: boolean;
|
||||
weight?: number;
|
||||
@@ -36,6 +34,18 @@ export interface ShopCreate {
|
||||
export interface GroceryInEvent {
|
||||
grocery_id: number;
|
||||
amount: number;
|
||||
price: number;
|
||||
}
|
||||
|
||||
export interface GroceryWithEventData {
|
||||
id: number;
|
||||
name: string;
|
||||
category: string;
|
||||
organic: boolean;
|
||||
weight?: number;
|
||||
weight_unit: string;
|
||||
amount: number;
|
||||
price: number;
|
||||
}
|
||||
|
||||
export interface ShoppingEvent {
|
||||
@@ -46,7 +56,7 @@ export interface ShoppingEvent {
|
||||
notes?: string;
|
||||
created_at: string;
|
||||
shop: Shop;
|
||||
groceries: Grocery[];
|
||||
groceries: GroceryWithEventData[];
|
||||
}
|
||||
|
||||
export interface ShoppingEventCreate {
|
||||
|
||||
Reference in New Issue
Block a user