Merge pull request '(FEAT): Allow larger serving sizes.' (#77) from dev into master
All checks were successful
Deploy application with Docker / build_and_deploy (push) Successful in 59s

Reviewed-on: #77
This commit is contained in:
Hayden Hargreaves 2026-01-13 12:29:55 -07:00
commit 194c738d07
4 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,14 @@
-- Author: Hayden Hargreaves (hhargreaves2006@gmail.com)
-- Desc: Update recipes table to allow larger serving sizes.
-- Date: 01/13/2026
BEGIN;
ALTER TABLE recipes
DROP CONSTRAINT recipes_serves_check;
ALTER TABLE recipes
ADD CONSTRAINT recipes_serves_check
CHECK (serves >= 0 AND serves <= 127);
COMMIT;

View File

@ -12,3 +12,5 @@ psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infra
psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infrastructure/database/migrations/010_create_recipe_of_the_week_procedure.sql psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infrastructure/database/migrations/010_create_recipe_of_the_week_procedure.sql
psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infrastructure/database/migrations/011_update_engagement_enum.sql psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infrastructure/database/migrations/011_update_engagement_enum.sql
psql -h "$PSQL_HOST" -U "$PSQL_USERNAME" -d "$PSQL_DATABASE" -f ./internal/infrastructure/database/migrations/013_update_recipes_allow_large_servings.sql

View File

@ -34,7 +34,7 @@ export function validateCreateRecipeForm(values: CreateRecipeFormValues, dirty:
servingSize: dirty.servingSize servingSize: dirty.servingSize
? values.servingSize !== "" && ? values.servingSize !== "" &&
Number(values.servingSize) >= 1 && Number(values.servingSize) >= 1 &&
Number(values.servingSize) <= 16 Number(values.servingSize) <= 127
: true, : true,
category: dirty.category category: dirty.category
? values.category !== "" && isRecipeMeal(values.category) ? values.category !== "" && isRecipeMeal(values.category)

View File

@ -385,7 +385,7 @@ export default function Create() {
error="Please enter a serving size." error="Please enter a serving size."
parentClasses="flex-grow w-1/3" parentClasses="flex-grow w-1/3"
min="1" min="1"
max="16" max="127"
classes={INPUT_CLASSES} classes={INPUT_CLASSES}
/> />
</div> </div>