From b5af9d633386e1e9139888cbe272ff4d34e6219b Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Tue, 7 Jan 2020 22:48:20 +0300 Subject: Improve updating and deleting on Scoreboard page --- src/components/SolutionCard/SolutionCard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components/SolutionCard') diff --git a/src/components/SolutionCard/SolutionCard.js b/src/components/SolutionCard/SolutionCard.js index 7cca74c..1fff873 100644 --- a/src/components/SolutionCard/SolutionCard.js +++ b/src/components/SolutionCard/SolutionCard.js @@ -54,9 +54,10 @@ const SolutionCard = ({ data, removeThisCard }) => { }; const handleDelete = () => { - del(`solutions/${data.id}/`); + del(`solutions/${data.id}/`).then(() => { + removeThisCard(data.id); + }); handleClose(); - removeThisCard(data.id); }; return ( -- cgit v1.2.3