G
G
grabbee2020-11-20 17:21:51
symfony
grabbee, 2020-11-20 17:21:51

Where to check the condition on the sent data?

Some form is sent. I need to check/limit the number of such "posts". For example 10 per day. Where can I check this? Symfony\Component\Validator\Constraint doesn't seem to be suitable for this. He checks the data himself.

The bottom line is that, for example, there are no controllers in Api-Platform as such. Do I need to write "listener" and check it in it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2020-11-20
@glaphire

You can try to fasten the rate limiter component , but IMHO it's better to create your own logic with a set of rules, how to evaluate the frequency of submitting the form and a custom message in case the limit is exceeded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question