Skip to content

Wrong data types in courses service #42

Description

@Poetro

On

return this.http.get<Course[]>("/api/courses")

it should be

this.http.get<{payload: Course[]}>

so you need to to do additional casting with


as TypeScript would already know the type of the payload, so you can do

map(res => res.payload)

and it would already have the correct type.

Same goes for all the other HTTP requests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions