Skip to content

Inconsistent casing #16

@michaelprather

Description

@michaelprather

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: "john.doe@acme.com",
  password: "foo"
})

This succeeds

import { Ident } from "provide-js"

const user = await Ident.createUser({
  first_name: "John",
  last_name: "Doe",
  email: "john.doe@acme.com",
  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: 'john@acme.com',
  permissions: 415,
  privacyPolicyAgreedAt: null,
  termsOfServiceAgreedAt: null
}
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions