add updated_at fields
This commit is contained in:
@@ -158,6 +158,15 @@ const ShopList: React.FC = () => {
|
||||
</svg>
|
||||
Added {new Date(shop.created_at).toLocaleDateString()}
|
||||
</div>
|
||||
|
||||
{shop.updated_at && (
|
||||
<div className="flex items-center text-sm text-gray-600">
|
||||
<svg className="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
|
||||
</svg>
|
||||
Updated {new Date(shop.updated_at).toLocaleDateString()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -133,9 +133,17 @@ const ShoppingEventList: React.FC = () => {
|
||||
)}
|
||||
|
||||
<div className="flex justify-between items-center text-sm">
|
||||
<span className="text-gray-500">
|
||||
Event #{event.id} • {new Date(event.created_at).toLocaleDateString()}
|
||||
</span>
|
||||
<div className="text-gray-500">
|
||||
<div>Event #{event.id} • Created {new Date(event.created_at).toLocaleDateString()}</div>
|
||||
{event.updated_at && (
|
||||
<div className="flex items-center mt-1">
|
||||
<svg className="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
|
||||
</svg>
|
||||
Updated {new Date(event.updated_at).toLocaleDateString()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex space-x-2">
|
||||
<button
|
||||
onClick={() => navigate(`/shopping-events/${event.id}/edit`)}
|
||||
|
||||
@@ -23,6 +23,7 @@ export interface Shop {
|
||||
city: string;
|
||||
address?: string;
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface ShopCreate {
|
||||
@@ -55,6 +56,7 @@ export interface ShoppingEvent {
|
||||
total_amount?: number;
|
||||
notes?: string;
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
shop: Shop;
|
||||
groceries: GroceryWithEventData[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user