I am using Angular 8, and am querying an endpoint to get a permissions object. When I call it via Postman, I get the following returned JSON:
GET https://endpoint/@{xxx}/permissions
Returns:
{
"continents": {
"order": 2,
"actions": {
"show": true
},
"children": {}
},
"car manufacturers": {
"order": 3,
"actions": {
"show": true
},
"children": {}
},
"products": {
"order": 1,
"actions": {
"show": true,
"getItems": {
"type": "GET",
"URL": "https://endpoint/@{xxx}/products"
},
"updateItem": {
"type": "PUT",
"URL": "https://endpoint/@{xxx}/products/{id}"
},
"addItem": {
"type": "POST",
"URL": "https://endpoint/@{xxx}/products"
}
},
"slug": "/products/",
"children": {}
}
}
In Angular 8, I then have a service, where I want to make an http call to to the endpoint that will return the above JSON.
// GET
GetIssues(): Observable<Permissions> {
return this.http.get<Permissions>(this.baseurl + '/permissions/')
.pipe(
retry(1),
catchError(this.errorHandl)
)
}
As you can see the result needs to be put into the Permissions object.
Question
In TypeScript, what should this Permissions object look like?
export class Permissions {
...
}
I appreciate your help.