Skip to content

Wrong data types in courses service #42

@Poetro

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.

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