Browse Source

stuff

develop
Baptiste Lemoine 3 years ago
parent
commit
7e4e80f1ed
  1. 18
      src/app/services/config.service.ts
  2. 2
      update-demo.sh

18
src/app/services/config.service.ts

@ -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
@ -318,11 +332,11 @@ export class ConfigService extends PollConfig {
voteStack = {
pseudo: this.myName,
email: this.myEmail,
answers: this.answers
votes: this.convertChoicesAnsweredToSend(this.currentPoll.choices),
}
}
this.http.post(
`${this.baseHref}/poll/${this.pollId}/vote`,
`${this.baseHref}/poll/${this.currentPoll.id}/vote`,
voteStack,
this.makeHeaders())
.subscribe((res: any) => {

2
update-demo.sh

@ -4,4 +4,4 @@ git pull origin dev
yarn install --pure-lockfile
yarn build:demo
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…
Cancel
Save