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

params can''t support rename for field #283

Closed
zieglar opened this issue Sep 30, 2019 · 7 comments · Fixed by #292
Closed

params can''t support rename for field #283

zieglar opened this issue Sep 30, 2019 · 7 comments · Fixed by #292

Comments

@zieglar
Copy link

zieglar commented Sep 30, 2019

params: {
  inquiryPatientId: { field: 'id', type: 'uuid', primary: true },
},

image

@miquelferrerllompart
Copy link

Same problem here:

@Crud({
  model: {
    type: Device,
  },
  params: {
    deviceKey: {
      field: "deviceKey",
      type: "uuid",
      primary: true,
    },
  },
})

But the swagger shows:

Screenshot 2019-10-04 at 09 09 01

Maybe some wrong configuration?

@cuni0716
Copy link

cuni0716 commented Oct 4, 2019

any news here?

@michaelyali
Copy link
Member

Swagger related but will be fixed after few typeorm bugs that are left

@miquelferrerllompart
Copy link

thanks, @zMotivat0r!!
But I think is both of them, crud and swagger, because the endpoint doesn't works

@michaelyali
Copy link
Member

because the endpoint doesn't works

could you please elaborate?

@miquelferrerllompart
Copy link

@zMotivat0r sure! sorry 😅

We have a Postgres database with TypeORM where the primary column for devices entity is deviceKey.

When we generate the crud we have all the endpoints for devices but for all of them the main param is :id where should be :deviceKey

We try to override it with the params object inside the crud config but still doesn't work. When we try to get some device resource like devices/:deviceKey doesn't work, because :deveiceKey is not a correct param, and the endpoint devices/:id neither work because is :id not exist in postgress

@zieglar
Copy link
Author

zieglar commented Oct 4, 2019

@miquelferrerllompart your problem is can't redefine primary key, my problem is can't use new name in params define

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 a pull request may close this issue.

4 participants