Fix payment display and dashboard refresh functionality
Some checks failed
CI / update (push) Failing after 4s
Some checks failed
CI / update (push) Failing after 4s
- Fix 'paid in full for others' payments showing CHF 0.00 instead of actual amount - Add time-based sorting to payments (date + createdAt) for proper chronological order - Redirect to dashboard after adding payment instead of payments list - Implement complete dashboard refresh after payment deletion via modal - Fix dashboard component reactivity for single debtor view updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ export const GET: RequestHandler = async ({ locals, url }) => {
|
||||
}
|
||||
},
|
||||
{ $unwind: '$paymentId' },
|
||||
{ $sort: { 'paymentId.date': -1 } },
|
||||
{ $sort: { 'paymentId.date': -1, 'paymentId.createdAt': -1 } },
|
||||
{ $limit: 10 }
|
||||
]);
|
||||
|
||||
|
@@ -18,7 +18,7 @@ export const GET: RequestHandler = async ({ locals, url }) => {
|
||||
try {
|
||||
const payments = await Payment.find()
|
||||
.populate('splits')
|
||||
.sort({ date: -1 })
|
||||
.sort({ date: -1, createdAt: -1 })
|
||||
.limit(limit)
|
||||
.skip(offset)
|
||||
.lean();
|
||||
|
Reference in New Issue
Block a user