The GroupBuilder sends the create form as multipart/form-data (FormData). The code decided JSON vs form by checking — when no file was attached, request.files was empty/falsy, so it tried get_json() on a multipart body and lost the product field -> 400 'provide product info' even though the user filled the product name. Fix: branch on the Content-Type (multipart/form-data -> request.form) instead of request.files. Added a regression test (multipart create with product only -> 201). Verified live: multipart product-only create now returns 201.
9.2 KiB
9.2 KiB