Update EditView onClick

Hey there!

I’m trying to write a plugin that can take data from another API and write it into the strapi database on click. I managed to get the data and injected a button to the EditView window. The plugin uses a post request to a controller and the uses strapi.query('api::model.model').update(data) to update values.

This works fine, however after updating the values are not displayed since this all happens server-side. Is there a way to trigger a ‘re-render’ of the content/view without completely reloading the page?

I just managed to do it with React’s router:

import { useHistory } from 'react-router-dom';
const Component = () => {
  const history = useHistory();
  history.push(`contentype/path/:id`)
}
1 Like