Skip to content

Callback function does not accept promises #99

@ahelord

Description

@ahelord

I am trying to pass the parameter of the route to a promise to return the names of the clients but I do not succeed I have tried this

 async getNameForUser(id: string):string{
   const message = await this.getAsyncName("1");
   return message



  }

  public async getAsyncName(id: string): Promise<string> {

    const response = await this.userService.getUserByIdUser(+id)
    return response.first_name
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions