Verified Commit 01265070 authored by Florent Chehab's avatar Florent Chehab
Browse files

refactor(withNetworkParams): clarified params

* propKey => addDataToProp
parent 6245e2d3
......@@ -49,5 +49,7 @@ ExternalDataUpdateInfo.propTypes = {
ExternalDataUpdateInfo.defaultProps = {};
export default withNetworkWrapper([
new NetWrapParam("externalDataUpdateInfo", "all", { propKey: "updates" })
new NetWrapParam("externalDataUpdateInfo", "all", {
addDataToProp: "updates"
})
])(ExternalDataUpdateInfo);
......@@ -55,7 +55,7 @@ InformationList.defaultProps = {
export default compose(
withNetworkWrapper([
new NetWrapParam("information", "all", {
propKey: "informationList",
addDataToProp: "informationList",
params: RequestParams.Builder.withQueryParam("now", "true").build()
})
]),
......
......@@ -27,7 +27,7 @@ export default compose(
withNetworkWrapper(
[
new NetWrapParam("information", "all", {
propKey: "informationList",
addDataToProp: "informationList",
params: RequestParams.Builder.withQueryParam("now", "true").build()
})
],
......
......@@ -76,6 +76,6 @@ UnlinkedPartners.propTypes = {
export default withNetworkWrapper([
new NetWrapParam("unlinkedUtcPartners", "all", {
propKey: "unlinkedPartners"
addDataToProp: "unlinkedPartners"
})
])(UnlinkedPartners);
......@@ -32,7 +32,7 @@ ThemeProvider.propTypes = {
export default withNetworkWrapper([
new NetWrapParam("userData", "one", {
propKey: "userData",
addDataToProp: "userData",
params: RequestParams.Builder.withId(CURRENT_USER_ID).build()
})
])(ThemeProvider);
......@@ -152,7 +152,7 @@ const buildParams = modelInfo => {
export default compose(
withNetworkWrapper([
new NetWrapParam("versions", "all", {
propKey: "versions",
addDataToProp: "versions",
params: props => buildParams(props.modelInfo),
propTypes: {
modelInfo: PropTypes.shape({
......
......@@ -127,7 +127,7 @@ const buildParams = modelInfo => {
export default compose(
withNetworkWrapper([
new NetWrapParam("pendingModerationObj", "all", {
propKey: "pendingModeration",
addDataToProp: "pendingModeration",
params: props => buildParams(props.modelInfo),
propTypes: {
modelInfo: PropTypes.shape({
......
......@@ -88,7 +88,7 @@ const buildParams = match =>
export default compose(
withNetworkWrapper([
new NetWrapParam("exchanges", "one", {
propKey: "exchange",
addDataToProp: "exchange",
params: props => buildParams(props.match),
propTypes: {
match: PropTypes.shape({
......
......@@ -62,7 +62,7 @@ const buildFilesParams = match =>
export default compose(
withNetworkWrapper([
new NetWrapParam("pictures", "all", {
propKey: "pictures",
addDataToProp: "pictures",
params: props => buildPictureParams(props.match),
propTypes: {
match: PropTypes.shape({
......@@ -73,7 +73,7 @@ export default compose(
}
}),
new NetWrapParam("files", "all", {
propKey: "files",
addDataToProp: "files",
params: props => buildFilesParams(props.match),
propTypes: {
match: PropTypes.shape({
......
......@@ -182,6 +182,8 @@ SelectListSubPage.propTypes = {
export default compose(
withNetworkWrapper([
new NetWrapParam("recommendationLists", "all", { propKey: "lists" })
new NetWrapParam("recommendationLists", "all", {
addDataToProp: "lists"
})
])
)(SelectListSubPage);
......@@ -31,7 +31,7 @@ const buildParams = listId => RequestParams.Builder.withId(listId).build();
export default compose(
withNetworkWrapper([
new NetWrapParam("recommendationLists", "one", {
propKey: "list",
addDataToProp: "list",
params: props => buildParams(props.listId),
propTypes: {
listId: PropTypes.number.isRequired
......
......@@ -332,7 +332,7 @@ const styles = theme => ({
const ConnectedComp = compose(
withNetworkWrapper([
new NetWrapParam("userData", "one", {
propKey: "userData",
addDataToProp: "userData",
params: RequestParams.Builder.withId(CURRENT_USER_ID).build()
})
]),
......
......@@ -69,7 +69,7 @@ export default compose(
withUnivInfo(["countryId"]),
withNetworkWrapper([
new NetWrapParam("countryDri", "all", {
propKey: "countryDriItems",
addDataToProp: "countryDriItems",
params: props => buildParams(props.countryId),
propTypes: {
countryId: PropTypes.string.isRequired
......
......@@ -68,7 +68,7 @@ export default compose(
withUnivInfo(["countryId", "country"]),
withNetworkWrapper([
new NetWrapParam("countryScholarships", "all", {
propKey: "countryScholarshipsItems",
addDataToProp: "countryScholarshipsItems",
params: props => buildParams(props.countryId),
propTypes: {
countryId: PropTypes.string.isRequired
......
......@@ -45,7 +45,7 @@ export default compose(
withUnivInfo(),
withNetworkWrapper([
new NetWrapParam("sharedUnivFeedbacks", "all", {
propKey: "feedback",
addDataToProp: "feedback",
params: props => buildParams(props.univId),
propTypes: {
univId: PropTypes.number.isRequired
......
......@@ -66,7 +66,7 @@ export default compose(
withUnivInfo(["countryId"]),
withNetworkWrapper([
new NetWrapParam("universityDri", "all", {
propKey: "univDriItems",
addDataToProp: "univDriItems",
params: props => buildParams(props.univId),
propTypes: {
univId: PropTypes.string.isRequired
......
......@@ -108,7 +108,7 @@ export default compose(
withUnivInfo(["city", "country"]),
withNetworkWrapper([
new NetWrapParam("universities", "one", {
propKey: "university",
addDataToProp: "university",
params: props => buildParams(props.univId),
propTypes: {
univId: PropTypes.number.isRequired
......
......@@ -187,7 +187,7 @@ const ConnectedComponent = compose(
withUnivInfo(),
withNetworkWrapper([
new NetWrapParam("offers", "all", {
propKey: "offers",
addDataToProp: "offers",
params: props => buildParams(props.univId, props.page),
propTypes: {
univId: PropTypes.number.isRequired,
......
......@@ -66,7 +66,7 @@ export default compose(
withUnivInfo(),
withNetworkWrapper([
new NetWrapParam("universityScholarships", "all", {
propKey: "univScholarshipsItems",
addDataToProp: "univScholarshipsItems",
params: props => buildParams(props.univId),
propTypes: {
univId: PropTypes.number.isRequired
......
......@@ -144,7 +144,7 @@ export default compose(
withUnivInfo(),
withNetworkWrapper([
new NetWrapParam("universitiesSemestersDates", "one", {
propKey: "semestersDates",
addDataToProp: "semestersDates",
params: props => buildParams(props.univId),
propTypes: {
univId: PropTypes.number.isRequired
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment