Open Grygon opened 1 year ago
Ah I see, looks like we need to add validation to the frontend. This is the backend:
class CreatePlanEntry(MealieModel):
date: date
entry_type: PlanEntryType = PlanEntryType.breakfast
title: str = ""
text: str = ""
recipe_id: UUID | None
@validator("recipe_id", always=True)
@classmethod
def id_or_title(cls, value, values):
if bool(value) is False and bool(values["title"]) is False:
raise ValueError(f"`recipe_id={value}` or `title={values['title']}` must be provided")
return value
Fixed by 776d56eb75d2738d3a8584b5378c65dd39edd06c
Adding bug confirmed, based on Michael's comment way back when.
Bump. Can we get this fix implemented?
It seems that the fix is not a part of this repo, but it's ready to use (idk Vue, but looks correct), so it's probably a quick upgrade that fixes pretty annoying bug 👍🏻
I've just tested the solution posted here and it doesn't seem to work for me - the UI tells me the field is required but doesn't actually stop me submitting it and hitting the 422 error. I'm not going to dig into it any more right now.
First Check
What is the issue you are experiencing?
Planning to handle in #2399 but submitting since it may be a little while before I get to it.
Deployment
Docker (Linux)
Deployment Details
No response