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

Request/Feat: Sanitize string id keys before find, update, and delete actions #5

Closed
wants to merge 1 commit into from

Conversation

cylkdev
Copy link
Contributor

@cylkdev cylkdev commented Jul 31, 2021

I'm requesting we add a fallback to sanitize string ID keys before the find, update, and delete actions.

  • It removes overhead from a common use case where the data is sent from a controller to the EctoShorts.Actions making it easier to use out of the box

  • In the event the 'ID' is not the correct type the wrong EctoShorts.Actions action function will be called. The error message it outputs due to this doesn't make it clear this is why it fails. Eg: Here the changeset function was expecting a schema and instead got passed the ID as a string because currently EctoShorts.Actions .update() for eg only handles ints, and lists and therefore tried applying an update call with the wrong params.
    ss
    This catches those fall through cases and makes it clear the type of 'ID' trying to be inserted into a table must explicitly match the type of 'ID' in the table which is of type INT/integer

@cylkdev cylkdev closed this Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant