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

CLI should allow CrudController for a KV Repository #4909

Closed
emonddr opened this issue Mar 17, 2020 · 3 comments
Closed

CLI should allow CrudController for a KV Repository #4909

emonddr opened this issue Mar 17, 2020 · 3 comments

Comments

@emonddr
Copy link
Contributor

emonddr commented Mar 17, 2020

Currently there is no default crud controller for a kv repository , as per: #2737 .

So the CLI shouldn't let the user choose a CrudController IF the user is pointing to a KV repository.

Currently, the CLI creates a controller meant for a DefaultCrudRepository, and it contains compile errors because it believes the repository is a defaultCrudRepository instead of a KV repository.

e.g.

src/controllers/sub.controller.ts:51:38 - error TS2339: Property 'create' does not exist on type 'SubsidiaryRepository'.

51     return this.subsidiaryRepository.create(subsidiary);
                                        ~~~~~~

src/controllers/sub.controller.ts:65:38 - error TS2339: Property 'count' does not exist on type 'SubsidiaryRepository'.

65     return this.subsidiaryRepository.count(where);
                                        ~~~~~

src/controllers/sub.controller.ts:86:38 - error TS2339: Property 'find' does not exist on type 'SubsidiaryRepository'.

86     return this.subsidiaryRepository.find(filter);
                                        ~~~~

src/controllers/sub.controller.ts:108:38 - error TS2339: Property 'updateAll' does not exist on type 'SubsidiaryRepository'.

108     return this.subsidiaryRepository.updateAll(subsidiary, where);
                                         ~~~~~~~~~

src/controllers/sub.controller.ts:127:38 - error TS2339: Property 'findById' does not exist on type 'SubsidiaryRepository'.

127     return this.subsidiaryRepository.findById(id, filter);
                                         ~~~~~~~~

src/controllers/sub.controller.ts:148:37 - error TS2339: Property 'updateById' does not exist on type 'SubsidiaryRepository'.

148     await this.subsidiaryRepository.updateById(id, subsidiary);
                                        ~~~~~~~~~~

src/controllers/sub.controller.ts:162:37 - error TS2339: Property 'replaceById' does not exist on type 'SubsidiaryRepository'.

162     await this.subsidiaryRepository.replaceById(id, subsidiary);
                                        ~~~~~~~~~~~

src/controllers/sub.controller.ts:173:37 - error TS2339: Property 'deleteById' does not exist on type 'SubsidiaryRepository'.

173     await this.subsidiaryRepository.deleteById(id);
                                        ~~~~~~~~~~


Steps to reproduce

Current Behavior

Expected Behavior

Link to reproduction sandbox

Additional information

Related Issues

See Reporting Issues for more tips on writing good issues

@dhmlau
Copy link
Member

dhmlau commented Mar 18, 2020

@raymondfeng, would this be a duplicate of #2737?

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Dec 25, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants