Mes candidatures start
This commit is contained in:
@@ -128,7 +128,9 @@ class Answer extends Component {
|
||||
this.props.updateUserRequest(data)
|
||||
|
||||
console.log(this.props.companyId)
|
||||
this.props.postAdAnswerRequest({companyId:this.props.companyId, mediaId:this.props.mediaId})
|
||||
console.log(this.props.adId)
|
||||
console.log(this.props.mediaId)
|
||||
this.props.postAdAnswerRequest({adId: this.props.adId, companyId:this.props.companyId, mediaId:this.props.mediaId})
|
||||
}
|
||||
|
||||
inputFilesystemChange = (e) => {
|
||||
|
||||
@@ -153,8 +153,8 @@ class AnswerRowComponent extends React.Component {
|
||||
|
||||
{!rowData.is_promoted && (
|
||||
<Fragment>
|
||||
<IconText classes={{ root: classes.iconText, icon: classes.iconTextIcon, text: classes.iconTextText }} variant="location_on" text={rowData.ad.extra.contract_type} />
|
||||
<IconText classes={{ root: classes.iconText, icon: classes.iconTextIcon, text: classes.iconTextText }} variant="business_center" text={rowData.ad.location.gmap_address.formatted_address} />
|
||||
{/* <IconText classes={{ root: classes.iconText, icon: classes.iconTextIcon, text: classes.iconTextText }} variant="location_on" text={rowData.ad.extra.contract_type} />
|
||||
<IconText classes={{ root: classes.iconText, icon: classes.iconTextIcon, text: classes.iconTextText }} variant="business_center" text={rowData.ad.location.gmap_address.formatted_address} /> */}
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ export default {
|
||||
},
|
||||
answers: {
|
||||
postAnswer: (payload) => {
|
||||
return axios.post("/api/answers", {mediaId: payload.mediaId, company:payload.companyId}).then(res => res)},
|
||||
return axios.post("/api/answers", {adId : payload.adId, mediaId: payload.mediaId, companyId:payload.companyId}).then(res => res)},
|
||||
fetchAdsAnswered: () =>{
|
||||
return axios.get(`api/answers`).then(res => res.data)
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class Candidature extends React.Component {
|
||||
<TabContainer dir={'x'}>
|
||||
<Fragment>
|
||||
Candidature
|
||||
{ this.props.answer.id}
|
||||
{ this.props.id}
|
||||
</Fragment>
|
||||
</TabContainer>
|
||||
<TabContainer dir={'x'}>
|
||||
@@ -124,17 +124,20 @@ Candidature.propTypes = {
|
||||
id: PropTypes.number
|
||||
};
|
||||
|
||||
Company.getInitialProps = function (context) {
|
||||
Candidature.getInitialProps = function (context) {
|
||||
console.log("getInitialProps")
|
||||
const { id } = context.query
|
||||
console.log(id)
|
||||
return {id}
|
||||
return {id:id}
|
||||
}
|
||||
|
||||
function mapStateToProps(state) {
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
let answ = Object.keys(state.answers).length !== 0 && AnswersSelector(state)[ownProps.id]
|
||||
console.log("mapStateToProps")
|
||||
console.log(ownProps)
|
||||
console.log(answ)
|
||||
return {
|
||||
answer = Object.keys(state.answers).length !== 0 && AnswersSelector(state)[this.props.id],
|
||||
answer : answ,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,8 @@ class Reponse extends React.Component {
|
||||
) :
|
||||
(
|
||||
<Answer mediaId={!!this.props.media && this.props.media.id}
|
||||
companyId={offre.company.id}></Answer>
|
||||
companyId={offre.company.id}
|
||||
adId={offre.id}></Answer>
|
||||
)}
|
||||
</Layout>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user