I am trying to update record in Lightning Web component through lightning-record-form. The issue I am facing is - I does not show updated records on Save immediately until I refresh it. I have tried using refreshApex, calling apex imperatively also. But nothing worked for me.
Here's my code -
@api recordId;
@track bears;
wiredbearResult;
@wire(searchBears, {searchTerm: '$searchTerm'})
wiredBears(result) {
console.log('result', result);
this.wiredbearResult = result;
if (result.data) {
this.bears = result.data;
} else if (result.error) {
this.error = result.error;
}
}
handleSubmit(event) {
return refreshApex(this.wiredbearResult);
}
And this is my html file code -
<lightning-record-form
record-id={recordId}
object-api-name="Bear__c"
layout-type="Full"
mode="edit"
onsubmit={handleSubmit}>
</lightning-record-form>
Any suggestions, what I am missing?