Why the deleted data still appear in the interface?

后端 未结 1 1606
失恋的感觉
失恋的感觉 2020-12-22 08:46

Look here :

When I click button delete, data deleted still appear in the interface.

I look at the table in the database, the data is erased.

相关标签:
1条回答
  • 2020-12-22 09:43

    I see you are also using the rinvex repository. I don't see your code about fetch data. I assume you are fetching data from the repository cache. In your repository, your delete function.

    public function delete($id){
        return $this->delete($id);
    }
    

    this should clear the repository cache. if you would like clear the cache of the repository manually, try the following in your repository method.

    $this->forgetCache();
    

    or

    $this->getContainer('events')->fire($this->getRepositoryId() . '.entity.updated', [$this, $modelInstance]);
    

    actually forgetCache() method shall do, I'm using it in my repository after I made mass update to my table.

    0 讨论(0)
提交回复
热议问题