Skip to content

Creating New Route/Model #1

Description

@tacshooter

I've pretty much copied from User on both the frontend and backend to make a Client model. When I try to call it from the frontend though, I get no results. If I go to find and comment out the .where() call, it returns properly and if I go to actionUtils.js and return {} from parseCriteria, it works fine. I don't understand why the dump of where looks different when I'm calling /v1/user than it does when I'm calling /v1/client. Any ideas? Below are the dumps of the where for each call...

$sails.get('/v1/user', params)...
{ sort: 'id',
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1Njk2ODExOTk1ZDJhYmQ0MDk4MDBlZTYiLCJmaXJzdE5hbWUiOiJLZW4iLCJ1c2VybmFtZSI6ImFkbWluIiwiYWNjZXNzTGV2ZWwiOjIsInR5cGUiOiJ1c2VyIiwiaWF0IjoxNDUzMzEwMzIzfQ.Mg1iw_2WiP9UWSxOmONjZeA6Nh0mRIi9vOrlGGulGZs' } {} []

$sails.get('/v1/client', params)...
{ params:
{ sort: 'id',
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1Njk2ODExOTk1ZDJhYmQ0MDk4MDBlZTYiLCJmaXJzdE5hbWUiOiJLZW4iLCJ1c2VybmFtZSI6ImFkbWluIiwiYWNjZXNzTGV2ZWwiOjIsInR5cGUiOiJ1c2VyIiwiaWF0IjoxNDUzMzEwMzIzfQ.Mg1iw_2WiP9UWSxOmONjZeA6Nh0mRIi9vOrlGGulGZs' } }

But the client.model.js file and user.model.js file making the calls are identical, other than changing the work user to client wherever it exists...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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