Fix bug. Allow to fetch tickets (of type actAsType:customer) using th… #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Why is this change necessary?
There's a bug, so when you try to follow the API instructions, in order to fetch tickets,
you can't fetch tickets based on a particular customer email.
2. What does this change do, exactly?
The code below has some problems, I guess:
The first line:
Should be:
Because the API should be expecting the get query params.
The third line:
Should be:
because $repository is not defined. I guess we want to access the $ticketRepository to get the customers.
3. Please link to the relevant issues (if any).
I opened a issue here: #16
It should be mentioned that if you try to filter by agent, that is still not working.
If you try this endpoint: {my_localhost_url}/api/v1/tickets?actAsEmail={agent@agentemail.com}&actAsType=agent
The API returns:
So I guess there's a problem with this line:
You could change $data['actAsEmail'] by $request->query->get('actAsEmail') and the error disappear.
The problem is that after that, if we try to filter by agent email the API returns all the tickets everytime.