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

custom identifier in crud routes not working (example-app, Bookstore) #395

Open
colorcube opened this issue Dec 26, 2022 · 0 comments
Open
Labels
needs-replication Needs replication code

Comments

@colorcube
Copy link
Contributor

Using debug console or browser I can query some test users:

http://0.0.0.0:9999/entity/user

[
    {
        "id": 1,
        "created": "2022-12-23T18:20:53.988Z",
        "username": "test"
    },
    {
        "id": 2,
        "created": "2022-12-23T18:30:53.874Z",
        "username": "test2"
    }
]

A query by username doesn't work:

http://0.0.0.0:9999/entity/user/test2

[ERROR] Controller parameter resolving error: Error: Invalid get<T> argument given undefined
    at Injector.get (/var/www/deepkit-test/node_modules/@deepkit/injector/src/injector.ts:248:15)
    at InjectorContext.get (/var/www/deepkit-test/node_modules/@deepkit/injector/src/injector.ts:866:25)
    at HttpResolveParametersEvent.parameters [as parameterResolver] (eval at build (/var/www/deepkit-test/node_modules/@deepkit/core/src/compiler.ts:95:20), <anonymous>:206:58)
    at HttpListener.onResolveParameters (/var/www/deepkit-test/node_modules/@deepkit/http/src/http.ts:619:44)
    at self (eval at buildAsync (/var/www/deepkit-test/node_modules/@deepkit/core/src/compiler.ts:111:20), <anonymous>:165:52)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async HttpKernel.handleRequest (/var/www/deepkit-test/node_modules/@deepkit/http/src/kernel.ts:40:17)
[LOG] 127.0.0.1 - GET "/entity/user/test2" 500 ""

And the debug API browser doesn't show the id input field for username.

related code

createCrudRoutes([User], { identifier: 'username', identifierChangeable: true }

I see the same behaviour in my custom test app.

BTW I can see that most packages are at version alpha 85, some are at 77.

├── @deepkit/api-console-module@1.0.1-alpha.85
├── @deepkit/app@1.0.1-alpha.85
├── @deepkit/broker@1.0.1-alpha.85
├── @deepkit/bson@1.0.1-alpha.85
├── @deepkit/core-rxjs@1.0.1-alpha.77
├── @deepkit/core@1.0.1-alpha.77
├── @deepkit/event@1.0.1-alpha.85
├── @deepkit/framework@1.0.1-alpha.85
├── @deepkit/http@1.0.1-alpha.85
├── @deepkit/injector@1.0.1-alpha.85
├── @deepkit/logger@1.0.1-alpha.77
├── @deepkit/mongo@1.0.1-alpha.85
├── @deepkit/orm@1.0.1-alpha.85
├── @deepkit/rpc-tcp@1.0.1-alpha.85
├── @deepkit/rpc@1.0.1-alpha.85
├── @deepkit/sql@1.0.1-alpha.85
├── @deepkit/sqlite@1.0.1-alpha.85
├── @deepkit/stopwatch@1.0.1-alpha.85
├── @deepkit/template@1.0.1-alpha.85
├── @deepkit/type-compiler@1.0.1-alpha.83
├── @deepkit/type@1.0.1-alpha.85
├── @deepkit/workflow@1.0.1-alpha.85
├── deepkit-openapi@0.0.6
@marcj marcj added the needs-replication Needs replication code label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-replication Needs replication code
Projects
None yet
Development

No branches or pull requests

2 participants