From ff134ba1809fe3f96b806051ac6f4afb52c4304e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 14 Jun 2020 19:56:33 +0200 Subject: properly sorting and deleting tiles --- frontend/views/page/components/tile.form.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'frontend/views/page/components/tile.form.js') diff --git a/frontend/views/page/components/tile.form.js b/frontend/views/page/components/tile.form.js index 8d26173..dd8da96 100644 --- a/frontend/views/page/components/tile.form.js +++ b/frontend/views/page/components/tile.form.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Link } from 'react-router-dom' +import actions from '../../../actions' import { session } from '../../../session' import { @@ -288,10 +289,12 @@ class TileForm extends Component { } handleDelete() { - const { temporaryTile, isNew } = this.props - const tile_id = temporaryTile.id + const { temporaryTile, isNew, onClose } = this.props if (confirm('Really delete this tile?')) { - actions.tile.delete(temporaryTile.id) + actions.tile.destroy(temporaryTile) + .then(() => { + onClose() + }) } } -- cgit v1.2.3-70-g09d2