You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add Edit Donation Goal UI with reset functionality and tester route
* Refine spacing
* feat: add goal update functionality with admin interface and validation
* fix: remove unused subMessage prop from GrowingGoal component
* Default edit field & admin growing goal title
* reflect currently raised instead of hardcode in editgoal
* MM-DD-YYYY format via helper for frontend to conform w/ design, backend still uses YYYY-MM-DD
---------
Co-authored-by: Thanin Kongkiatsophon <108406347+thaninbew@users.noreply.github.com>
@@ -348,26 +349,27 @@ export class DonationsService {
348
349
returnstream;
349
350
}
350
351
351
-
asyncgetActiveGoalSummary(){
352
-
// --- TEMPORARY MOCK FOR TESTING ---
353
-
return{
354
-
goal: {
355
-
id: 999,
356
-
targetAmount: 50000,
357
-
startDate: '2026-01-01',
358
-
endDate: '2026-06-30',
359
-
dateRangeLabel: 'January - June 2026',
360
-
},
361
-
amountRaised: 31336,
362
-
progressPercent: 62.67,
363
-
};
364
-
/*
352
+
asyncgetActiveGoalSummary(): Promise<{
353
+
goal: {
354
+
id: number;
355
+
title: string;
356
+
targetAmount: number;
357
+
startDate: string;
358
+
endDate: string;
359
+
dateRangeLabel: string;
360
+
}|null;
361
+
amountRaised: number;
362
+
progressPercent: number;
363
+
}>{
365
364
consttoday=newDate().toISOString().split('T')[0];
366
-
365
+
367
366
// 1. find active goal
368
367
constgoal=awaitthis.goalRepository
369
368
.createQueryBuilder('goal')
370
-
.where(':today BETWEEN goal.startDate AND goal.endDate', { today })
369
+
.where(
370
+
'(:today BETWEEN goal.startDate AND goal.endDate) OR (goal.startDate <= :today AND goal.endDate IS NULL) OR (goal.startDate IS NULL AND goal.endDate >= :today) OR (goal.startDate IS NULL AND goal.endDate IS NULL)',
371
+
{ today },
372
+
)
371
373
.orderBy('goal.startDate','DESC')
372
374
.getOne();
373
375
@@ -384,10 +386,10 @@ export class DonationsService {
0 commit comments