I have already checked the questions of the past, but I could not find a solution that worked for me.
I am using Vue Typescript:
export default Vue.extend({
data() {
return {
...
selectedOrder: null,
};
},
approveOrder() {
if(this.selectedOrder !== undefined && this.selectedOrder!==null && this.selectedOrder !== '') {
let uri = 'http://localhost:8081/v1/order/approve/';
uri = uri + this.selectedOrder.processInstanceId + '?approverId=' + this.getUser;
Error I get is:
164:21 Object is possibly 'null'.
162 | let uri = 'http://localhost:8081/v1/order/approve/';
163 |
> 164 | uri = uri + this.selectedOrder.processInstanceId + '?approverId=' + this.getUser;
| ^
selectedOrder: ''?property 'processInstanceId' does not exist on type 'string'.this.selectedOrder.processInstanceId.toString()Property 'processInstanceId' does not exist on type 'string'.