Skip to content
Snippets Groups Projects
Commit 4a89274e authored by MahiFaiyaz's avatar MahiFaiyaz
Browse files

modified formatData method

parent 05419e0d
No related branches found
No related tags found
1 merge request!4Subreddit feature
......@@ -23,8 +23,9 @@ const formatData = (data, dataKey, dataValue) => {
}
result.push(obj)
}
result.sort((a,b) => {
return b[dataValue] - a[dataValue]})
if (dataKey !== 'hour'){
result.sort((a,b) => {
return b[dataValue] - a[dataValue]})}
return result
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment