Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tag API route missing notes input #464

Closed
Allcharles opened this issue Jun 9, 2020 · 1 comment · Fixed by #465
Closed

New tag API route missing notes input #464

Allcharles opened this issue Jun 9, 2020 · 1 comment · Fixed by #465
Assignees

Comments

@Allcharles
Copy link
Collaborator

Currently the tags controller fails to properly handle a new tag with attached notes value.

To replicate:
POST /tags

Body:

{
	"text": "test tag",
	"isTaxanomic": true,
	"typeOfTag": "common_species",
	"notes": {
		"test": 42,
		"value": "testing"
	}
}

On request, the following error is given:

image

@Allcharles Allcharles added this to the Workbench Client milestone Jun 9, 2020
@Allcharles Allcharles self-assigned this Jun 9, 2020
@atruskie
Copy link
Member

You didn't "break" it. The notes parameter just needs to be added to the list of allowed parameters.

This line: https://github.com/QutEcoacoustics/baw-server/blob/master/app/controllers/tags_controller.rb#L72

Actually, it seems like notes is already permitted. Perhaps it is because it's an object instead of a string?

You can read more about strong params from here: https://edgeguides.rubyonrails.org/action_controller_overview.html#strong-parameters

@Allcharles Allcharles changed the title Broke New Tag API Route New tag API route missing notes input Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants