(FEAT): Allow larger serving sizes. #77

Merged
azpect merged 1 commits from dev into master 2026-01-13 12:29:55 -07:00
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/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
? values.servingSize !== "" &&
Number(values.servingSize) >= 1 &&
Number(values.servingSize) <= 16
Number(values.servingSize) <= 127
: true,
category: dirty.category
? values.category !== "" && isRecipeMeal(values.category)

View File

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