weight edit fixes
Deploy / deploy-dev (push) Successful in 3m1s
Deploy / deploy-prod (push) Has been skipped

This commit is contained in:
Corey Blais
2026-06-16 15:28:01 -04:00
parent 4d3ab0b143
commit 1140be8f32
3 changed files with 17 additions and 31 deletions
+7 -1
View File
@@ -909,7 +909,13 @@ export const updateWeightForBird = async (
notes = $5
WHERE id = $1
AND bird_id = $2
AND recorded_on >= CURRENT_DATE - (2 * INTERVAL '1 day')
AND id IN (
SELECT recent.id
FROM weight_records recent
WHERE recent.bird_id = $2
ORDER BY recent.recorded_on DESC, recent.created_at DESC
LIMIT 3
)
RETURNING id, bird_id, weight_grams, recorded_on::text, notes`,
[weightId, birdId, weightGrams, recordedOn, notes],
);