mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
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
|
||||
@ -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) => {
|
||||
|
@ -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…
Reference in New Issue
Block a user