Skip to content

Commit e907ecb

Browse files
committed
lowercase data for backend and add birthday date
1 parent e6b113f commit e907ecb

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

frontend/src/components/app/onboarding/SelectionButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
v-bind:class="{
44
'onboarding-sub-container-content-button-outline': true,
55
'mt-2': true,
6+
'capitalize': true,
67
'onboarding-sub-container-content-button-outline-selected': selected,
78
'cursor-default': invalid,
89
}"

frontend/src/views/app/Onboarding.vue

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
v-if="slideCurrent === 0"></Introduction>
88
<SingleChoice
99
v-bind:slide="{
10-
key: 'age',
10+
key: 'birthdate',
1111
current: slideCurrent,
1212
count: slideCount,
1313
header: 'My age',
@@ -21,7 +21,7 @@
2121
current: slideCurrent,
2222
count: slideCount,
2323
header: 'I am',
24-
options: ['Male', 'Female', 'Other'],
24+
options: ['male', 'female', 'other'],
2525
buttonText}"
2626
v-on:saveInput="saveInput"
2727
v-if="slideCurrent === 2"></SingleChoice>
@@ -31,26 +31,26 @@
3131
current: slideCurrent,
3232
count: slideCount,
3333
header: 'Sexuality',
34-
options: ['Heterosexual', 'Homosexual', 'Bi-sexual', 'Other'],
34+
options: ['heterosexual', 'homosexual', 'bi-sexual', 'other'],
3535
buttonText}"
3636
v-on:saveInput="saveInput"
3737
v-if="slideCurrent === 3"></SingleChoice>
3838
<MultipleChoice
3939
v-bind:slide="{
40-
key: 'interests' ,
40+
key: 'tags' ,
4141
current: slideCurrent,
4242
count: slideCount,
4343
header: 'Interests',
4444
options: [
45-
'Swimming', 'Wine', 'Reading', 'Foodie', 'Netflix', 'Music', 'Yoga', 'Golf',
46-
'Photography', 'Baking', 'Shopping', 'Outdoors', 'Art', 'Travel', 'Hiking',
47-
'Running', 'Volunteering', 'Cycling', 'Climbing', 'Tea', 'Fishing', 'Soccer',
48-
'Museum', 'Dancing', 'Surfing', 'Karaoke', 'Grab a drink', 'DIY',
49-
'Walking', 'Cat lover', 'Movies', 'Gardening', 'Trivia', 'Working out',
50-
'Cooking', 'Gamer', 'Brunch', 'Blogging', 'Picknicking', 'Athlete',
51-
'Dog lover', 'Politics', 'Environmentalism', 'Instagram', 'Spirituality',
52-
'Language exchange', 'Sports', 'Comdey', 'Fashion', 'Disney', 'Vlogging',
53-
'Astrology', 'Board Games', 'Craft Beer', 'Coffee', 'Writer',
45+
'swimming', 'wine', 'reading', 'foodie', 'netflix', 'music', 'yoga', 'golf',
46+
'photography', 'baking', 'shopping', 'outdoors', 'art', 'travel', 'hiking',
47+
'running', 'volunteering', 'cycling', 'climbing', 'tea', 'fishing', 'soccer',
48+
'museum', 'dancing', 'surfing', 'karaoke', 'parties', 'diy',
49+
'walking', 'cat lover', 'movies', 'gardening', 'trivia', 'working out',
50+
'cooking', 'gamer', 'brunch', 'blogging', 'picknicking', 'athlete',
51+
'dog lover', 'politics', 'environmentalism', 'instagram', 'spirituality',
52+
'language exchange', 'sports', 'comedy', 'fashion', 'disney', 'vlogging',
53+
'astrology', 'board games', 'craft beer', 'coffee', 'writer',
5454
],
5555
minOptionsForSelection: 3,
5656
maxOptionsForSelection: 10,
@@ -106,7 +106,10 @@ export default {
106106
}),
107107
methods: {
108108
saveInput(...args) {
109-
const [key, value] = args;
109+
let [key, value] = args;
110+
if (key === 'birthdate') {
111+
value = this.formatBirthdate(value);
112+
}
110113
this.userData[key] = value;
111114
console.log(this.userData);
112115
this.nextSlide();
@@ -126,6 +129,10 @@ export default {
126129
}
127130
return ages;
128131
},
132+
formatBirthdate(age) {
133+
let birthyear = new Date().getFullYear() - age;
134+
return '01/01/' + birthyear;
135+
},
129136
},
130137
computed: {
131138
buttonText() {

0 commit comments

Comments
 (0)