forked from tykayn/funky-framadate-front
stuff
This commit is contained in:
parent
346bd9dc4f
commit
7e4e80f1ed
@ -307,6 +307,20 @@ export class ConfigService extends PollConfig {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* conversion to send to back
|
||||||
|
* @param choiceList
|
||||||
|
*/
|
||||||
|
convertChoicesAnsweredToSend(choiceList) {
|
||||||
|
const converted = choiceList.map(elem => {
|
||||||
|
return {
|
||||||
|
choice_id: elem.id,
|
||||||
|
value: elem.answer
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log('converted', converted);
|
||||||
|
return converted;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST
|
* POST
|
||||||
@ -318,11 +332,11 @@ export class ConfigService extends PollConfig {
|
|||||||
voteStack = {
|
voteStack = {
|
||||||
pseudo: this.myName,
|
pseudo: this.myName,
|
||||||
email: this.myEmail,
|
email: this.myEmail,
|
||||||
answers: this.answers
|
votes: this.convertChoicesAnsweredToSend(this.currentPoll.choices),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.http.post(
|
this.http.post(
|
||||||
`${this.baseHref}/poll/${this.pollId}/vote`,
|
`${this.baseHref}/poll/${this.currentPoll.id}/vote`,
|
||||||
voteStack,
|
voteStack,
|
||||||
this.makeHeaders())
|
this.makeHeaders())
|
||||||
.subscribe((res: any) => {
|
.subscribe((res: any) => {
|
||||||
|
@ -4,4 +4,4 @@ git pull origin dev
|
|||||||
yarn install --pure-lockfile
|
yarn install --pure-lockfile
|
||||||
yarn build:demo
|
yarn build:demo
|
||||||
sudo cp -r ./dist/framadate/* ../framadate-api/public/
|
sudo cp -r ./dist/framadate/* ../framadate-api/public/
|
||||||
echo " now check update demo at https://framadate-api.cipherbliss.com/index.html "
|
echo " now check update demo at https://framadate-api.cipherbliss.com"
|
||||||
|
Loading…
Reference in New Issue
Block a user