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

Inconsistent casing #16

Open
michaelprather opened this issue Sep 9, 2021 · 0 comments
Open

Inconsistent casing #16

michaelprather opened this issue Sep 9, 2021 · 0 comments

Comments

@michaelprather
Copy link

Description

Property name casing is inconsistent. Request parameters must be passed in snake_case but the response is camelCase. This may be intended behavior and I've only tested this with Ident.createUser.

Steps to reproduce

This results in a 422 error

import { Ident } from "provide-js"

const user = await Ident.createUser({
  firstName: "John",
  lastName: "Doe",
  email: "[email protected]",
  password: "foo"
})

This succeeds

import { Ident } from "provide-js"

const user = await Ident.createUser({
  first_name: "John",
  last_name: "Doe",
  email: "[email protected]",
  password: "foo"
})

console.log(user)

/*
Model {
  id: '8dc3339b-323f-472e-a761-e37f2eea1e3a',
  createdAt: '2021-09-09T16:09:01.774093147Z',
  name: 'Joe User',
  firstName: 'Joe',
  lastName: 'User',
  email: '[email protected]',
  permissions: 415,
  privacyPolicyAgreedAt: null,
  termsOfServiceAgreedAt: null
}
*/
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

No branches or pull requests

1 participant