diff --git a/src/components/index/indexConsole/commands/fetchCommands/Album/GetOne.js b/src/components/index/indexConsole/commands/fetchCommands/Album/GetOne.js index 38fbf6e..5e03fb4 100644 --- a/src/components/index/indexConsole/commands/fetchCommands/Album/GetOne.js +++ b/src/components/index/indexConsole/commands/fetchCommands/Album/GetOne.js @@ -46,7 +46,7 @@ const AlbumGetOne = ({ return mapRowToString( album, mapFields ) } - const getOneAlbumFetch = () => { + const getOneFetch = () => { AbstractGetOne( refList, consoleHistory, @@ -68,7 +68,7 @@ const AlbumGetOne = ({ { + + const [message, setMessage] = useState('') + + const getOneInput = React.createRef() + + let refList = [ + getOneInput + ] + + let inputList = [ + { + type: 'info', + action: 'GetOne', + endpoint: 'Track' + }, + { + type: 'text', + name: 'id', + ref: getOneInput + } + ] + + const mapTrackToString = ( album ) => { + let mapFields = [ + 'title', + 'id', + 'album_id', + 'user_id', + 'url_code' + ] + return mapRowToString( album, mapFields ) + } + + const getOneFetch = () => { + AbstractGetOne( + refList, + consoleHistory, + setConsoleHistory, + setMessage, + getOneTrack, + mapTrackToString + ) + } + + const resetState = () => { + setConsoleHistory( consoleHistory + message ) + setComponentVisible( false ) + setMessage('') + } + + return ( +
+ + +
+ ) +} + +const mapStateToProps = state => ({ + album: state.album +}) + +const mapDispatchToProps = dispatch => ({ + getOneTrack: (id) => dispatch( getOneTrack(id) ) + +}) + +export default connect(mapStateToProps, mapDispatchToProps)(TrackGetOne) \ No newline at end of file