Skip to content

Commit 5cef506

Browse files
committed
Some TODO comments added
1 parent 2c292d5 commit 5cef506

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/shared/reducers/challenge-listing/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,13 @@ export function factory(req) {
271271

272272
if (req) {
273273
state.filter = req.query.filter;
274+
275+
/* TODO: OK, fine, this validation of dates does the server-side part of
276+
* the trick, while the frontend part (removing them from URL) is done
277+
* elsewhere (/src/shared/routes/Topcoder/ChallengeListing), but it should
278+
* be changed that everything is handled here in the reducer code (only
279+
* this way we can ensure that it works all around, including community
280+
* challenge listings). */
274281
if (!!state.filter && !!state.filter.startDate
275282
&& moment(state.filter.startDate).isValid() === false) {
276283
delete state.filter.startDate;

src/shared/routes/Topcoder/ChallengeListing.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default function ChallengeListingRoute() {
2323
).then(({ default: ChallengeListing }) => {
2424
const query = renderProps.location.search ?
2525
qs.parse(renderProps.location.search.slice(1)) : null;
26+
27+
/* TODO: This validation of start and end dates from query params
28+
* does the trick of removing invalid dates from URL at the client
29+
* side, but it actually should be done in the reducer as well. */
2630
if (query.filter && query.filter.startDate
2731
&& !moment(query.filter.startDate).isValid()) {
2832
delete query.filter.startDate;
@@ -32,6 +36,7 @@ export default function ChallengeListingRoute() {
3236
delete query.filter.endDate;
3337
}
3438
updateQuery({ filter: query.filter });
39+
3540
const currencyFromUrl = _.get(query, 'currency');
3641
const prizeMode = currencyFromUrl && `money-${currencyFromUrl}`;
3742
return (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1503496800,"base":"USD","rates":{"AED":3.672973,"AFN":68.8825,"ALL":112.25,"AMD":478.572298,"ANG":1.7795,"AOA":165.9205,"ARS":17.1851,"AUD":1.267203,"AWG":1.795504,"AZN":1.7,"BAM":1.6581,"BBD":2,"BDT":81.228683,"BGN":1.658254,"BHD":0.37704,"BIF":1725,"BMD":1,"BND":1.362404,"BOB":6.972833,"BRL":3.160475,"BSD":1,"BTC":0.000236411194,"BTN":64.116224,"BWP":10.222107,"BYN":1.930945,"BZD":2.015086,"CAD":1.257895,"CDF":1600,"CHF":0.965674,"CLF":0.02387,"CLP":641.4,"CNH":6.66656,"CNY":6.6611,"COP":2989.79,"CRC":576.22,"CUC":1,"CUP":25.5,"CVE":94.1,"CZK":22.152921,"DJF":178.57,"DKK":6.304009,"DOP":47.131,"DZD":109.95,"EGP":17.74,"ERN":15.345659,"ETB":23.258364,"EUR":0.847586,"FJD":2.022499,"FKP":0.781767,"GBP":0.781767,"GEL":2.394275,"GGP":0.781767,"GHS":4.41,"GIP":0.781767,"GMD":46.125,"GNF":8887.6,"GTQ":7.27135,"GYD":207.830851,"HKD":7.826028,"HNL":23.375691,"HRK":6.2792,"HTG":64.461254,"HUF":256.078333,"IDR":13350.75345,"ILS":3.614304,"IMP":0.781767,"INR":64.0644,"IQD":1167.65,"IRR":32859,"ISK":107.41125,"JEP":0.781767,"JMD":127.802183,"JOD":0.709001,"JPY":109.1921,"KES":103.195,"KGS":68.632592,"KHR":4095.75,"KMF":419.219527,"KPW":900,"KRW":1130.94,"KWD":0.301912,"KYD":0.833082,"KZT":333.779041,"LAK":8285.55,"LBP":1507.75,"LKR":152.731919,"LRD":115.005853,"LSL":13.23556,"LYD":1.368765,"MAD":9.424201,"MDL":17.915302,"MGA":2952.5,"MKD":52.2585,"MMK":1366.36006,"MNT":2437.670874,"MOP":8.058161,"MRO":364.9,"MUR":33.226,"MVR":15.450233,"MWK":725.61,"MXN":17.74495,"MYR":4.278534,"MZN":60.994761,"NAD":13.26125,"NGN":361.5,"NIO":29.915408,"NOK":7.888925,"NPR":102.55,"NZD":1.386174,"OMR":0.384985,"PAB":1,"PEN":3.238987,"PGK":3.180999,"PHP":51.160667,"PKR":105.325922,"PLN":3.62883,"PYG":5595.8,"QAR":3.672501,"RON":3.886665,"RSD":101.130779,"RUB":59.148,"RWF":828.81,"SAR":3.7502,"SBD":7.754399,"SCR":13.673139,"SDG":6.68,"SEK":8.090595,"SGD":1.36202,"SHP":0.781767,"SLL":7550,"SOS":578.345,"SRD":7.438,"SSP":125.2166,"STD":20781.898308,"SVC":8.747434,"SYP":514.98499,"SZL":13.241279,"THB":33.35,"TJS":8.807589,"TMT":3.499986,"TND":2.448652,"TOP":2.222702,"TRY":3.497701,"TTD":6.775398,"TWD":30.281549,"TZS":2238.3,"UAH":25.571451,"UGX":3599,"USD":1,"UYU":28.715422,"UZS":4181.1,"VEF":10.01295,"VND":22714.153233,"VUV":105.166488,"WST":2.503962,"XAF":555.980076,"XAG":0.05882873,"XAU":0.00077661,"XCD":2.70255,"XDR":0.709645,"XOF":555.980076,"XPD":0.00107142,"XPF":101.143933,"XPT":0.00102042,"YER":250.325,"ZAR":13.25142,"ZMW":9.03,"ZWL":322.355011}}
1+
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1504094400,"base":"USD","rates":{"AED":3.672993,"AFN":68.434,"ALL":111.7,"AMD":478.037813,"ANG":1.78016,"AOA":165.9205,"ARS":17.3759,"AUD":1.258944,"AWG":1.794996,"AZN":1.7,"BAM":1.637155,"BBD":2,"BDT":81.301229,"BGN":1.638412,"BHD":0.377064,"BIF":1740.480974,"BMD":1,"BND":1.356099,"BOB":6.975584,"BRL":3.1658,"BSD":1,"BTC":0.000218893995,"BTN":63.98413,"BWP":10.117236,"BYN":1.93245,"BZD":2.015866,"CAD":1.254589,"CDF":1550.480769,"CHF":0.957745,"CLF":0.02327,"CLP":627.53,"CNH":6.596306,"CNY":6.591954,"COP":2935,"CRC":576.356761,"CUC":1,"CUP":25.5,"CVE":92.05,"CZK":21.833487,"DJF":178.97,"DKK":6.237503,"DOP":47.058472,"DZD":110.6425,"EGP":17.66,"ERN":15.335471,"ETB":23.213765,"EUR":0.83845,"FJD":2.012549,"FKP":0.773864,"GBP":0.773864,"GEL":2.421275,"GGP":0.773864,"GHS":4.435686,"GIP":0.773864,"GMD":46.075,"GNF":8889.35,"GTQ":7.287002,"GYD":207.92,"HKD":7.826275,"HNL":23.401272,"HRK":6.2166,"HTG":66.655042,"HUF":256.291667,"IDR":13343.842125,"ILS":3.579785,"IMP":0.773864,"INR":64.019,"IQD":1165.259957,"IRR":33062.267348,"ISK":105.3,"JEP":0.773864,"JMD":128.066489,"JOD":0.7085,"JPY":110.0806875,"KES":103.18375,"KGS":68.664403,"KHR":4049.4,"KMF":411.5,"KPW":900,"KRW":1123.12,"KWD":0.3014,"KYD":0.833499,"KZT":335.490293,"LAK":8290.15,"LBP":1509.108296,"LKR":152.844139,"LRD":115.088085,"LSL":13.025862,"LYD":1.362745,"MAD":9.35832,"MDL":17.812983,"MGA":2965.35,"MKD":51.63,"MMK":1366.36006,"MNT":2429.908099,"MOP":8.061282,"MRO":365.04565,"MUR":32.5505,"MVR":15.450233,"MWK":725.545,"MXN":17.84641,"MYR":4.268763,"MZN":61.41,"NAD":13.026223,"NGN":359.680566,"NIO":29.857062,"NOK":7.785542,"NPR":102.333153,"NZD":1.381965,"OMR":0.384981,"PAB":1,"PEN":3.239626,"PGK":3.184651,"PHP":51.228,"PKR":105.230492,"PLN":3.572052,"PYG":5648,"QAR":3.685006,"RON":3.8514,"RSD":99.862,"RUB":58.59465,"RWF":834.09,"SAR":3.750268,"SBD":7.795825,"SCR":13.7225,"SDG":6.677632,"SEK":7.976799,"SGD":1.356863,"SHP":0.773864,"SLL":7550.184032,"SOS":579.49834,"SRD":7.438,"SSP":124.9444,"STD":20471.6023,"SVC":8.75092,"SYP":515,"SZL":13.036105,"THB":33.2195,"TJS":8.816192,"TMT":3.504979,"TND":2.4306,"TOP":2.193576,"TRY":3.454709,"TTD":6.726398,"TWD":30.143104,"TZS":2242.2,"UAH":25.599924,"UGX":3600.55,"USD":1,"UYU":28.727472,"UZS":4182.7,"VEF":10.12298,"VND":22724.55232,"VUV":103.823289,"WST":2.483105,"XAF":549.987151,"XAG":0.05747127,"XAU":0.00076348,"XCD":2.70255,"XDR":0.702778,"XOF":549.987151,"XPD":0.00106217,"XPF":100.0537,"XPT":0.00100758,"YER":250.275,"ZAR":13.041288,"ZMW":9.036057,"ZWL":322.355011}}

0 commit comments

Comments
 (0)