change invoice action impl. changing .http sample file

This commit is contained in:
Dmitriynj
2020-12-08 21:48:57 +03:00
committed by Daniel Hutzel
parent 72616ae4ce
commit aeafb1d010
13 changed files with 142 additions and 110 deletions

View File

@@ -18,6 +18,16 @@ const EditAction = ({ ID, name, composer, genre, unitPrice, album, afterTrackUpd
setVisible(true);
};
const afterCloseModal = () => {
setUpdateLoading(true);
getTrack(ID)
.then((response) => {
afterTrackUpdate(response.data);
setUpdateLoading(false);
})
.catch(handleError);
};
const onFinish = (value) => {
setConfirmLoading(true);
updateTrack({
@@ -45,16 +55,6 @@ const EditAction = ({ ID, name, composer, genre, unitPrice, album, afterTrackUpd
setVisible(false);
};
const afterCloseModal = () => {
setUpdateLoading(true);
getTrack(ID)
.then((response) => {
afterTrackUpdate(response.data);
setUpdateLoading(false);
})
.catch(handleError);
};
return (
<>
{updateLoading ? <LoadingOutlined /> : <EditOutlined onClick={onShowModal} />}
@@ -86,11 +86,11 @@ const EditAction = ({ ID, name, composer, genre, unitPrice, album, afterTrackUpd
onFinish={onFinish}
onFinishFailed={() => console.log('Not valid params provided')}
initialValues={{
name: name,
composer: composer,
name,
composer,
genreID: genre.ID,
albumID: album.ID,
unitPrice: unitPrice,
unitPrice,
}}
>
<TrackForm initialAlbumTitle={album.title} />