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

feat(cli): add hasManyThrough to relation options #5938

Merged
merged 2 commits into from
Jul 24, 2020
Merged

feat(cli): add hasManyThrough to relation options #5938

merged 2 commits into from
Jul 24, 2020

Conversation

agnes512
Copy link
Contributor

@agnes512 agnes512 commented Jul 15, 2020

relates to #5836

The following could be specified through the cli:

  • source, target, and through model. (allow self-through)
  • sourceId, targetId on the through model
  • relation name

Besides primary key checking, property existence checking, the cli also does:

  • the through model won't be the same as source/target model ( they are excluded from the through model list)

Screen Shot 2020-07-15 at 7 48 56 PM

- checks if the input sourceId and targetId are the same (cli would not pass)

Screen Shot 2020-07-15 at 7 51 01 PM

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@agnes512 agnes512 force-pushed the hmt/cli branch 2 times, most recently from 962b58d to c6c11a7 Compare July 16, 2020 00:22
@agnes512 agnes512 marked this pull request as ready for review July 16, 2020 00:35
@agnes512 agnes512 requested a review from hacksparrow as a code owner July 16, 2020 00:35
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quickly skimmed through the changes and don't see any obvious problem 👍 I'll leave it up to code owners to review the details and give the final approval.

@dhmlau
Copy link
Member

dhmlau commented Jul 16, 2020

@agnes512, please update the lb4 relation docs for the CLI reference: https://loopback.io/doc/en/lb4/Relation-generator.html. It's fine if you're updating it in a separate PR. Thanks.

@hacksparrow
Copy link
Contributor

LGTM, except the missing doc. Discovered a bug, reported at #5996.

@agnes512
Copy link
Contributor Author

@hacksparrow docs are in #5947. Let's discuss the bug at #5996 .

@agnes512 agnes512 merged commit a86b177 into master Jul 24, 2020
@agnes512 agnes512 deleted the hmt/cli branch July 24, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants