Skip to content

Todo Tutorial Feedback -- Issues, Comments, Challenges #1206

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

Closed
12 of 17 tasks
virkt25 opened this issue Mar 28, 2018 · 8 comments
Closed
12 of 17 tasks

Todo Tutorial Feedback -- Issues, Comments, Challenges #1206

virkt25 opened this issue Mar 28, 2018 · 8 comments

Comments

@virkt25
Copy link
Contributor

virkt25 commented Mar 28, 2018

Description / Steps to reproduce / Feature proposal

As part of #729 I sat down with a user with no prior LoopBack experience (but a developer) and had him go through what is currently known as example-getting-started (pending rename to example-todo) Tutorial. I made notes during this process and gathered the following feedback from the user.



cc: @strongloop/lb-next-dev I think we should work on addressing some of these areas of concerns with the next release (after DP2).

@shimks
Copy link
Contributor

shimks commented Mar 28, 2018

This is some good feedback 👌

@shimks
Copy link
Contributor

shimks commented Apr 30, 2018

@virkt25 Could you update this task with an appropriate acceptance criteria? At first glance, this issue seems like it'll pan out to be a spike to see how the feedback could be addressed, but what do you think?

@dhmlau
Copy link
Member

dhmlau commented May 1, 2018

I agree that we need to work things out to have a set of acceptance criteria. However, I don't think there's a need for a spike, rather than fixing things up.

@virkt25
Copy link
Contributor Author

virkt25 commented May 1, 2018

No Spikes. I'll take an attempt at creating a Todo List (get it) for the tasks with some criteria.

@fjanon
Copy link

fjanon commented Sep 28, 2018

Adding some issues in the LB4 todo tutorial

https://loopback.io/doc/en/lb4/todo-tutorial-repository.html

  1. I think the code immediately following:
    NOTE: The index.ts file is an export helper file
    should be part of the note. It's confusing here, we are looking for the todo code for index.ts that's missing.
  2. the code for the index.ts is missing

In the controller page and code:
https://loopback.io/doc/en/lb4/todo-tutorial-controller.html

The return type for the method is Promise boolean:

@put('/todos/{id}')
  async replaceTodo(
    @param.path.number('id') id: number,
    @requestBody() todo: Todo,
    // Must change to Promise<void>
  ): Promise<boolean> {
    return await this.todoRepo.replaceById(id, todo);
  }

gives an error at compile and runtime times.

The correct return type for the method is Promise void :

  // from the finished example
  async replaceTodo(
    @param.path.number('id') id: number,
    @requestBody() todo: Todo,
  ): Promise<void> {
    await this.todoRepo.replaceById(id, todo);
  }


@bajtos
Copy link
Member

bajtos commented Oct 5, 2018

@fjanon thank you for the feedback! Would you mind contributing the proposed changes yourself? See DEVELOPING.md and contrib guide to get started.

@dhmlau
Copy link
Member

dhmlau commented Oct 19, 2018

@fjanon, I believe I've fixed them via PR #1846.
For creating controller in the tutorial, we now ask our users to select the REST Controller with CRUD functions option so that most of the code are generated. Thanks.

@dhmlau
Copy link
Member

dhmlau commented Nov 13, 2018

Closing as resolved.

@dhmlau dhmlau closed this as completed Nov 13, 2018
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

6 participants