BaryoDev / BaryoDev/barakoCMS

Forms: accept choice fields and return their options

Open
#845 0 comments 0 reactions 0 assignees View on GitHub
client-sites module
Dominant language
C#
Stars
6
Forks
7
Avg merge
4h 42m
Merged PRs (30d)
307

Description

The Forms module (#720, PR #821) was built before the choice field type (#803, PR #820) existed. rckoronadal.org's join form asks for an area of focus, and Color Me Fun asks for an entry type and shirt size, so a form must accept choice fields.

## Change

- `POST /api/public/forms/{slug}` accepts `choice` fields among the input types it allows, validated like any write: a value not offered is a 400 naming the accepted values.
- `GET /api/public/forms/{slug}` returns each choice field's `options` (value and label, in order) and `multiple`, so barakoPress renders a select, radios or checkboxes (BaryoDev/barakoPress#21).

## Done when

- A form with a single and a multiple choice field accepts offered values, refuses others with 400, and its GET lists the options in order.

## Where it lives

Module: `BarakoCMS.Forms`. It validates through the core's content validator, which already knows the choice type.

Contributor guide

Open the contributing guide

Research direction

Start in the BarakoCMS.Forms module with the POST and GET handlers for /api/public/forms/{slug}, then trace their use of the core content validator for choice fields. Verify single and multiple choice inputs, including rejection of unoffered values with a 400, and confirm GET returns ordered option values and labels plus multiple.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.