G
G
gitdev2021-02-02 12:42:50
symfony
gitdev, 2021-02-02 12:42:50

What pattern to use to return data from API?

There is a code in which I receive the data. What is the best way to form it?

$messages = $this->propositionChatService->getMessagesByProposition($proposition);

        return new JsonResponse([
            'messages' => $messages
        ]);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question