(FEAT): Allow larger serving sizes.
Now we can range between 1 and 127.
This commit is contained in:
parent
9d06e979b8
commit
8f3cdefe7e
@ -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;
|
||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user