Skip to content

Commit

Permalink
Merge pull request #1420 from Tampere/fix/project-object-validation
Browse files Browse the repository at this point in the history
Fix project object date validation
  • Loading branch information
mmoila authored Nov 26, 2024
2 parents 7f3df36 + e46757c commit a1144a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/components/projectObject/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export async function validateUpsertProjectObject(
extract(year FROM ${values?.endDate}::date) >= max(budget.year) AS "validBudgetEndDate",
CASE
WHEN ${values?.endDate} = 'infinity'
THEN extract(year FROM CURRENT_DATE) + 5 >= max(budget.year)
THEN GREATEST(extract(year FROM CURRENT_DATE), extract(year FROM ${values.startDate}::date)) + 5 >= max(budget.year)
ELSE true
END AS "validOngoingBudgetEndDate"
FROM app.budget
Expand Down

0 comments on commit a1144a3

Please sign in to comment.