Counter integration for collective.volto.formsupport
- Form counter for collective.volto.formsupport >= 3.2
Install collective.formsupport.counter by adding it to your buildout:
[buildout] ... eggs = collective.formsupport.counter
and then running bin/buildout
Reset the counter for a specific form block.
Endpoint:
/<document>/@counter
Method:
PATCH
Parameters:
block_id
(required) — The identifier of the form block.counter_value
(optional) — The value to set the counter to (default: 0).
Description:
This endpoint resets the form counter to a specified value.
Request Example:
PATCH /my-document/@reset-counter
Content-Type: application/json
{
"block_id": "form_block_123",
"counter_value": 5
}
Response:
Status Code:
204 No Content
The response indicates that the counter has been successfully reset. No response body is returned.
Retrieve the current counter value for a specific form block.
Endpoint:
/<document>/@counter
Method:
GET
Parameters:
block_id
(optional) — The identifier of the form block. The first available is being selected if not passed.
Description:
This endpoint retrieves the current value of the form counter.
Request Example:
GET /my-document/@counter?block_id=form_block_123
Accept: application/json
Response:
- Status Code:
200 OK
- Response Body:
{
"counter_value": 5
}
RedTurtle
- folix-01
- Issue Tracker: https://github.com/collective/collective.formsupport.counter/issues
- Source Code: https://github.com/collective/collective.formsupport.counter
- Documentation: https://docs.plone.org/foo/bar
If you are having issues, please let us know. We have a mailing list located at: [email protected]
The project is licensed under the GPLv2.