Просмотр исходного кода

:recycle: cleaning up profiler | simplifying in some areas

tags/0.0.3^2
j 3 лет назад
Родитель
Сommit
36a2af1a2a

+ 9
- 4
backend/db/data-generator/config.json Просмотреть файл

30
         "91401",
30
         "91401",
31
         "97075"
31
         "97075"
32
     ],
32
     ],
33
-    "resKeys": [1, 2, 3, 4, 5, 6],
33
+    "scoreKeys": [1, 2, 3, 4, 5, 6],
34
+    "nameKey": 7,
35
+    "emailKey": 8,
36
+    "passwordKey": 9,
34
     "zipcodeKey": 10,
37
     "zipcodeKey": 10,
35
     "mediaKey": 12,
38
     "mediaKey": 12,
36
     "langKey": 13,
39
     "langKey": 13,
40
+    "durationKey": 14,
41
+    "presenceKey": 15,
37
     "blurbKey": 16,
42
     "blurbKey": 16,
38
-    "comment": "Make this match profiler.js complete profile constructor",
39
-    "prefKeys": [10, 14, 15, 17, 18, 19],
40
-    "maxDistanceKey": 19
43
+    "urgencyKey": 17,
44
+    "pronounsKey": 18,
45
+    "distanceKey": 19
41
 }
46
 }

+ 2
- 2
backend/db/data-generator/index.js Просмотреть файл

138
                     case config.langKey:
138
                     case config.langKey:
139
                         resToEdit.val = random.language()
139
                         resToEdit.val = random.language()
140
                         break
140
                         break
141
-                    case 10:
141
+                    case config.durationKey:
142
                         resToEdit.val = random.duration()
142
                         resToEdit.val = random.duration()
143
                         break
143
                         break
144
-                    case 11:
144
+                    case config.presenceKey:
145
                         resToEdit.val = random.location()
145
                         resToEdit.val = random.location()
146
                         break
146
                         break
147
                     case config.blurbKey:
147
                     case config.blurbKey:

+ 17
- 7
backend/lib/routes/membership/active.js Просмотреть файл

81
              */
81
              */
82
             let pIds = groupings.reduce((ids, grouping) => {
82
             let pIds = groupings.reduce((ids, grouping) => {
83
                 grouping.profiles.forEach(p => {
83
                 grouping.profiles.forEach(p => {
84
-                    if (p.profile_id == profileId) return 
84
+                    if (p.profile_id == profileId) return
85
                     ids.push(p.profile_id)
85
                     ids.push(p.profile_id)
86
                     grouping.profile = p.profile_id
86
                     grouping.profile = p.profile_id
87
                 })
87
                 })
92
             const completedProfiles = await profileService.getProfilesFor(
92
             const completedProfiles = await profileService.getProfilesFor(
93
                 pIds,
93
                 pIds,
94
                 'participant',
94
                 'participant',
95
-                false,
96
             )
95
             )
97
 
96
 
98
             /** Grabs revealTags */
97
             /** Grabs revealTags */
99
-            const profileIdsFromCompletedProfiles = completedProfiles.map(p => p.profile_id)
98
+            const profileIdsFromCompletedProfiles = completedProfiles.map(
99
+                p => p.profile_id,
100
+            )
100
             const groupingIdsFromGroupings = groupings.map(g => g.grouping_id)
101
             const groupingIdsFromGroupings = groupings.map(g => g.grouping_id)
101
-            const revealTags = await profileService.getTagsFor(profileIdsFromCompletedProfiles, groupingIdsFromGroupings, 'reveal')
102
+            const revealTags = await profileService.getTagsFor(
103
+                profileIdsFromCompletedProfiles,
104
+                groupingIdsFromGroupings,
105
+                'reveal',
106
+            )
102
 
107
 
103
             /** If the revealTags exist, the completedProfile's hidden info is
108
             /** If the revealTags exist, the completedProfile's hidden info is
104
              * removed and replaced with the completedProfile's user information
109
              * removed and replaced with the completedProfile's user information
105
              * Otherwise the completedProfiles remain unchanged
110
              * Otherwise the completedProfiles remain unchanged
106
              */
111
              */
107
-            const userIdsFromCompletedProfiles = completedProfiles.map(p => p.user_id)
108
-            const user = await userService.findById(userIdsFromCompletedProfiles)
112
+            const userIdsFromCompletedProfiles = completedProfiles.map(
113
+                p => p.user_id,
114
+            )
115
+            const user = await userService.findById(
116
+                userIdsFromCompletedProfiles,
117
+            )
109
             if (revealTags && user) {
118
             if (revealTags && user) {
110
                 for (const t of revealTags) {
119
                 for (const t of revealTags) {
111
                     if (t.tag.tag_description) {
120
                     if (t.tag.tag_description) {
112
-                        completedProfiles[0][t.tag.tag_description] = user[t.tag.tag_description]
121
+                        completedProfiles[0][t.tag.tag_description] =
122
+                            user[t.tag.tag_description]
113
                     }
123
                     }
114
                 }
124
                 }
115
             }
125
             }

+ 27
- 24
backend/lib/routes/membership/reveal.js Просмотреть файл

36
             const grouping_id = request.params.grouping_id
36
             const grouping_id = request.params.grouping_id
37
             const { profile_id, tag_id } = request.query
37
             const { profile_id, tag_id } = request.query
38
             try {
38
             try {
39
-                const tags = await profileService.revealProfileInfo({
39
+                const associations = await profileService.revealProfileInfo({
40
                     profile_id,
40
                     profile_id,
41
                     grouping_id,
41
                     grouping_id,
42
                     tag_id,
42
                     tag_id,
51
                     membership => membership.profile_id,
51
                     membership => membership.profile_id,
52
                 )
52
                 )
53
                 if (idsInGroup.length > 2)
53
                 if (idsInGroup.length > 2)
54
-                    return console.error('ERROR: idsInGroup cannot have more than 2 entries: ', idsInGroup)
54
+                    return console.error(
55
+                        'ERROR: idsInGroup cannot have more than 2 entries: ',
56
+                        idsInGroup,
57
+                    )
55
                 // Grab User Info from Users Table
58
                 // Grab User Info from Users Table
56
-                const completeProfile = await profileService.getProfilesFor([profile_id], 'participant')
59
+                const completeProfile = await profileService.getProfilesFor(
60
+                    [profile_id],
61
+                    'participant',
62
+                )
63
+                const userInfo = await userService.findById(
64
+                    completeProfile[0].user_id,
65
+                )
57
 
66
 
58
                 // Grab the TagAssociation that matches the revealed profile
67
                 // Grab the TagAssociation that matches the revealed profile
59
-                // TODO: Check if there are multiple matching tags(?)(there shouldn't be)
60
-                const returnedTag = () => {
61
-                    let matchingTag
62
-                    tags.forEach(tagAssoc => {
63
-                        if (tagAssoc.grouping_id === grouping_id &&
64
-                            tagAssoc.profile_id === profile_id &&
65
-                            tagAssoc.tag_id === tag_id) {
66
-                            matchingTag = tagAssoc
67
-                        }
68
-                    })
69
-                    if (matchingTag)
70
-                        return matchingTag
71
-                    return console.error('ERROR: No matching tagAssociation')
72
-                }
73
-
74
-                const tag_description = returnedTag().tag.tag_description
75
-                const userInfo = await userService.findById(completeProfile[0].user_id)
76
-                const revealInfo = userInfo[tag_description]
68
+                // TODO: Check if there are multiple matching associations(?)(there shouldn't be)
69
+                let matchingAssociation = null
70
+                associations.forEach(tagAssoc => {
71
+                    if (
72
+                        tagAssoc.grouping_id === grouping_id &&
73
+                        tagAssoc.profile_id === profile_id &&
74
+                        tagAssoc.tag_id === tag_id
75
+                    ) {
76
+                        matchingAssociation = tagAssoc
77
+                    }
78
+                })
79
+                const description = matchingAssociation.tag.tag_description
77
 
80
 
78
                 idsInGroup.forEach(profile_id => {
81
                 idsInGroup.forEach(profile_id => {
79
                     request.server.methods.notify(
82
                     request.server.methods.notify(
80
                         `${profile_id}.stonk`,
83
                         `${profile_id}.stonk`,
81
                         {
84
                         {
82
                             name: 'REVEALED_INFO',
85
                             name: 'REVEALED_INFO',
83
-                            revealed_info: revealInfo,
86
+                            revealed_info: userInfo[description],
84
                             profile_id: completeProfile[0].profile_id,
87
                             profile_id: completeProfile[0].profile_id,
85
                             grouping_id: grouping_id,
88
                             grouping_id: grouping_id,
86
                             tag: tag_id,
89
                             tag: tag_id,
87
-                            description: tag_description,
90
+                            description,
88
                             type: 'info',
91
                             type: 'info',
89
                         },
92
                         },
90
                         h,
93
                         h,
94
                     .response({
97
                     .response({
95
                         ok: true,
98
                         ok: true,
96
                         handler: pluginConfig.handlerType,
99
                         handler: pluginConfig.handlerType,
97
-                        data: { tags },
100
+                        data: { tags: associations },
98
                     })
101
                     })
99
                     .code(200)
102
                     .code(200)
100
             } catch (err) {
103
             } catch (err) {

+ 21
- 16
backend/lib/routes/profile/queue.js Просмотреть файл

23
 
23
 
24
 const validators = {
24
 const validators = {
25
     params: params.profileId,
25
     params: params.profileId,
26
-    query: Joi.object({include_profile: Joi.bool(), limit: Joi.number(), offset: Joi.number()}),
26
+    query: Joi.object({
27
+        include_profile: Joi.bool(),
28
+        limit: Joi.number(),
29
+        offset: Joi.number(),
30
+    }),
27
 }
31
 }
28
 
32
 
29
 module.exports = {
33
 module.exports = {
37
         cors: true,
41
         cors: true,
38
         handler: async function (request, h) {
42
         handler: async function (request, h) {
39
             const { profile_id } = request.params
43
             const { profile_id } = request.params
40
-            const { include_profile, limit, offset} = request.query
44
+            const { limit, offset } = request.query
41
             const { profileService, matchQueueService } =
45
             const { profileService, matchQueueService } =
42
                 request.server.services()
46
                 request.server.services()
43
 
47
 
44
-            const queue = await matchQueueService.getQueue(profile_id, limit, offset)
48
+            const queue = await matchQueueService.getQueue(
49
+                profile_id,
50
+                limit,
51
+                offset,
52
+            )
45
             const queueIds = queue.map(entry => entry.target_id)
53
             const queueIds = queue.map(entry => entry.target_id)
46
-            const res = {
47
-                ok: true,
48
-                handler: pluginConfig.handlerType,
49
-                data: queueIds,
50
-            }
51
 
54
 
52
             // HELP: I think there's an issue here
55
             // HELP: I think there's an issue here
53
             // queueIds spits out the queue profiles in the correct order
56
             // queueIds spits out the queue profiles in the correct order
57
             //     'include_profile results',
60
             //     'include_profile results',
58
             //     await profileService.getProfilesFor(queueIds),
61
             //     await profileService.getProfilesFor(queueIds),
59
             // )
62
             // )
60
-            if (include_profile) {
61
-                res.data = await profileService.getProfilesFor(
62
-                    queueIds,
63
-                    'participant',
64
-                    false,
65
-                )
66
-            }
67
             try {
63
             try {
68
-                return h.response(res).code(200)
64
+                return h
65
+                    .response({
66
+                        ok: true,
67
+                        handler: pluginConfig.handlerType,
68
+                        data: await profileService.getProfilesFor(
69
+                            queueIds,
70
+                            'participant',
71
+                        ),
72
+                    })
73
+                    .code(200)
69
             } catch (err) {
74
             } catch (err) {
70
                 return h
75
                 return h
71
                     .response({
76
                     .response({

+ 4
- 8
backend/lib/services/profile/index.js Просмотреть файл

62
         matchingProfile.tags = matchingProfile.tags.map(
62
         matchingProfile.tags = matchingProfile.tags.map(
63
             tag => this.tagLookup[tag.tag_id],
63
             tag => this.tagLookup[tag.tag_id],
64
         )
64
         )
65
-        const complete = new profiler.CompleteProfile(matchingProfile, true)
66
-        return complete
65
+        return new profiler.CompleteProfile(matchingProfile)
67
     }
66
     }
68
 
67
 
69
     async getCompleteProfilesFor(userId, type) {
68
     async getCompleteProfilesFor(userId, type) {
76
             .whereIn('profile_id', dedupedProfileIds)
75
             .whereIn('profile_id', dedupedProfileIds)
77
             .withGraphFetched('tags')
76
             .withGraphFetched('tags')
78
             .withGraphFetched('responses')
77
             .withGraphFetched('responses')
79
-            // CHECKTHIS: Added this because we added user.user_name to CompleteProfile
80
-            // so without this, we get undefined user_name
81
             .withGraphFetched('user')
78
             .withGraphFetched('user')
82
 
79
 
83
         return profiler.makeCompleteFromProfileEntries(
80
         return profiler.makeCompleteFromProfileEntries(
87
         )
84
         )
88
     }
85
     }
89
 
86
 
90
-    async getProfilesFor(profileIdArray, type, includeResponses = true) {
87
+    async getProfilesFor(profileIdArray, type) {
91
         const { Profile } = this.server.models()
88
         const { Profile } = this.server.models()
92
         await this._setScoreLookup()
89
         await this._setScoreLookup()
93
         await this._setTagLookup()
90
         await this._setTagLookup()
106
             profileIdArray,
103
             profileIdArray,
107
             profilesEntries,
104
             profilesEntries,
108
             type,
105
             type,
109
-            includeResponses,
110
             this.tagLookup,
106
             this.tagLookup,
111
         )
107
         )
112
     }
108
     }
355
         await this._setTagLookup()
351
         await this._setTagLookup()
356
         let associations = groupingId
352
         let associations = groupingId
357
             ? await TagAssociation.query()
353
             ? await TagAssociation.query()
358
-                .where('grouping_id', groupingId)
359
-                .andWhere('profile_id', profileId)
354
+                  .where('grouping_id', groupingId)
355
+                  .andWhere('profile_id', profileId)
360
             : await TagAssociation.query().andWhere('profile_id', profileId)
356
             : await TagAssociation.query().andWhere('profile_id', profileId)
361
         return associations
357
         return associations
362
             .map(assoc => ({
358
             .map(assoc => ({

+ 58
- 61
backend/lib/services/profile/profiler.js Просмотреть файл

1
 const config = require('../../../db/data-generator/config.json')
1
 const config = require('../../../db/data-generator/config.json')
2
 
2
 
3
+/**
4
+ * Unscored preferences used for filtering
5
+ * Does NOT include blurb, media languages
6
+ */
7
+const unscoredProfilePreferences = [
8
+    'zipcode',
9
+    'duration',
10
+    'presence',
11
+    'urgency',
12
+    'pronouns',
13
+    'distance',
14
+]
15
+const otherProfileInfo = ['blurb', 'media', 'lang']
16
+
3
 /**
17
 /**
4
  * Class to hold our retrieved profile information
18
  * Class to hold our retrieved profile information
5
  * in a convenient wrapper
19
  * in a convenient wrapper
6
  * !: This needs to match the responseSchema in profiles.js
20
  * !: This needs to match the responseSchema in profiles.js
7
  */
21
  */
8
 class CompleteProfile {
22
 class CompleteProfile {
9
-    constructor(profile, includeResponses = false, type) {
23
+    constructor(profile, type) {
10
         this.user_id = profile.user_id // int user_id
24
         this.user_id = profile.user_id // int user_id
11
         this.profile_id = profile.profile_id // int profile_id
25
         this.profile_id = profile.profile_id // int profile_id
12
-        this.user_name = 'hidden_name'// string user_name
13
-        this.user_email = 'hidden@email.com'
14
-        this.responses = []
26
+        this.responses = profile.responses
15
         this.user_type = type
27
         this.user_type = type
16
-        // NOTE: just have all the tags in one place
17
-        this.tags = profile.tags.filter(t => t.tag_category !== 'reveal')
18
-        // TODO: generalize this for multiple images, and languages
19
-        this.profile_description = ''
20
-        this.profile_media = []
21
-        this.profile_languages = []
22
-        this.profile_prefs = {}
23
-        this.image = ''
24
-        this.blurb = ''
25
 
28
 
26
-        // TODO: Use reveal tags to add or remove information from profile!
27
-        // TODO: ---
28
-        // TODO: Use reveal tags to rebuild profile based on group/membership
29
-        // TODO: and include for certain profiles
29
+        this.profile_prefs = this.getPrefsFromResponses(this.responses)
30
 
30
 
31
+        otherProfileInfo.forEach(prefName => {
32
+            if (prefName == 'blurb') {
33
+                this.profile_description = this.responses.find(
34
+                    r => r.response_key_id === config.blurbKey,
35
+                ).val
36
+            } else if (['media', 'lang'].includes(prefName)) {
37
+                const key =
38
+                    prefName == 'media'
39
+                        ? `profile_${prefName}`
40
+                        : [`profile_${prefName}uages`]
41
+                this[key] = this.responses
42
+                    .filter(r => r.response_key_id === config[`${prefName}Key`])
43
+                    .map(r => r.val)
44
+            }
45
+        })
46
+        // TODO: These should be getters
47
+        this.user_name = 'bleh'
48
+        this.user_email = 'bleh@bleh.com'
31
         this.reveal = profile.tags.filter(t => t.tag_category == 'reveal')
49
         this.reveal = profile.tags.filter(t => t.tag_category == 'reveal')
32
-        // TODO: filter these correctly
33
-        if (profile?.responses?.length && includeResponses) {
34
-            // [] of all "profile" responses
35
-            this.responses = profile.responses
36
-            // image, language, duration, presence, blurb, urgency, role, pronouns, distance
37
-            const prefs = [
38
-                'zipcode',
39
-                'duration',
40
-                'presence',
41
-                'urgency',
42
-                'pronouns',
43
-                'distance',
44
-            ]
45
-            const prefsKeys = config.prefKeys
46
-            prefs.forEach((pref, i) => {
47
-                this.profile_prefs[pref] = this.responses.find(
48
-                    r => r.response_key_id === prefsKeys[i],
49
-                )
50
-            })
51
-            this.profile_description = this.responses.find(
52
-                r => r.response_key_id === config.blurbKey,
50
+        this.tags = profile.tags.filter(t => t.tag_category !== 'reveal')
51
+    }
52
+    /** Map pref name to dB key associated with preference */
53
+    get byPrefName() {
54
+        return unscoredProfilePreferences.reduce((byPref, prefName) => {
55
+            byPref[prefName] = this.responses.find(
56
+                r => config[`${prefName}Key`] == r.response_key_id,
53
             ).val
57
             ).val
54
-            this.profile_media = this.responses
55
-                .filter(r => r.response_key_id === config.mediaKey)
56
-                .map(r => r.val)
57
-            this.profile_languages = this.responses
58
-                .filter(r => r.response_key_id === config.langKey)
59
-                .map(r => r.val)
60
-        }
58
+            return byPref
59
+        }, {})
60
+    }
61
+    getPrefsFromResponses(responses) {
62
+        if (!responses.length) return
63
+        const prefs = {}
64
+        unscoredProfilePreferences.forEach(prefName => {
65
+            prefs[prefName] = this.byPrefName[prefName]
66
+        })
67
+        return prefs
61
     }
68
     }
62
 }
69
 }
63
-const _makeCompleteProfile = (
64
-    profileEntry,
65
-    type,
66
-    tagLookup,
67
-    includeResponses,
68
-) => {
70
+const _makeCompleteProfile = (profileEntry, type, tagLookup) => {
69
     profileEntry.tags = profileEntry.tags.map(tag => tagLookup[tag.tag_id])
71
     profileEntry.tags = profileEntry.tags.map(tag => tagLookup[tag.tag_id])
70
-    return new CompleteProfile(profileEntry, includeResponses, type)
72
+    return new CompleteProfile(profileEntry, type)
71
 }
73
 }
72
 
74
 
73
 const makeOrderedCompleteProfiles = (
75
 const makeOrderedCompleteProfiles = (
74
     orderedProfileIds,
76
     orderedProfileIds,
75
     profilesEntries,
77
     profilesEntries,
76
     type,
78
     type,
77
-    includeResponses,
78
     tagLookup,
79
     tagLookup,
79
 ) => {
80
 ) => {
80
-    const completeProfiles = []
81
-    orderedProfileIds.forEach(pid => {
82
-        profilesEntries.forEach(entry => {
83
-            if (entry.profile_id != pid) return
84
-            completeProfiles.push(
85
-                _makeCompleteProfile(entry, type, tagLookup, includeResponses),
86
-            )
81
+    return orderedProfileIds.map(pid => {
82
+        const foundEntry = profilesEntries.find(entry => {
83
+            pid == entry.profile_id
87
         })
84
         })
85
+        return _makeCompleteProfile(foundEntry, type, tagLookup)
88
     })
86
     })
89
-    return completeProfiles
90
 }
87
 }
91
 const makeCompleteFromProfileEntries = (profilesEntries, type, tagLookup) =>
88
 const makeCompleteFromProfileEntries = (profilesEntries, type, tagLookup) =>
92
     profilesEntries.map(entry => _makeCompleteProfile(entry, type, tagLookup))
89
     profilesEntries.map(entry => _makeCompleteProfile(entry, type, tagLookup))

+ 2
- 7
backend/lib/services/profile/scorer.js Просмотреть файл

18
     return scoreLookup
18
     return scoreLookup
19
 }
19
 }
20
 
20
 
21
-const _isScorableResponse = res_key_id => {
22
-    let isScorable = false
23
-    if (config.resKeys.includes(res_key_id)) {
24
-        isScorable = true
25
-    }
26
-    return isScorable
27
-}
21
+const _isScorableResponse = res_key_id =>
22
+    config.scoreKeys.includes(res_key_id) ? true : false
28
 
23
 
29
 const scoreResponses = (seeker, potentialMatch, prescoreLookup) => {
24
 const scoreResponses = (seeker, potentialMatch, prescoreLookup) => {
30
     if (seeker.responses.length != potentialMatch.responses.length)
25
     if (seeker.responses.length != potentialMatch.responses.length)

+ 6
- 4
frontend/src/services/notification.service.js Просмотреть файл

44
         }
44
         }
45
     }
45
     }
46
     _appendTagsToGrouping(parsed) {
46
     _appendTagsToGrouping(parsed) {
47
-        const foundGrouping = currentProfile.groupings.find(grouping =>
48
-            grouping.grouping_id === parsed.grouping_id
47
+        const foundGrouping = currentProfile.groupings.find(
48
+            grouping => grouping.grouping_id === parsed.grouping_id,
49
         )
49
         )
50
         if (foundGrouping) {
50
         if (foundGrouping) {
51
             const tagFromNotification = {
51
             const tagFromNotification = {
52
                 is_active: 1,
52
                 is_active: 1,
53
-                tag_category: "reveal",
53
+                tag_category: 'reveal',
54
                 profile_id: parsed.profile_id,
54
                 profile_id: parsed.profile_id,
55
                 tag_description: parsed.description,
55
                 tag_description: parsed.description,
56
                 tag_id: parsed.tag,
56
                 tag_id: parsed.tag,
58
             const target_desc = parsed.description
58
             const target_desc = parsed.description
59
             tagFromNotification[target_desc] = parsed.revealed_info
59
             tagFromNotification[target_desc] = parsed.revealed_info
60
             foundGrouping.profile.reveal.push(tagFromNotification)
60
             foundGrouping.profile.reveal.push(tagFromNotification)
61
-            foundGrouping.revealedFromNotification.value.push(tagFromNotification)
61
+            foundGrouping.revealedFromNotification.value.push(
62
+                tagFromNotification,
63
+            )
62
         }
64
         }
63
     }
65
     }
64
 }
66
 }

+ 3
- 3
frontend/src/views/SurveyView.vue Просмотреть файл

30
                                 @input='storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt])'
30
                                 @input='storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt])'
31
                                 @keyup.enter='step++'
31
                                 @keyup.enter='step++'
32
                                 v-model='profile[q.response_key_prompt]'
32
                                 v-model='profile[q.response_key_prompt]'
33
-                            ) 
33
+                            )
34
                             label >{{ profile[q.response_key_prompt] }}
34
                             label >{{ profile[q.response_key_prompt] }}
35
 
35
 
36
                         //- Aspects
36
                         //- Aspects
85
     signupUser,
85
     signupUser,
86
 } from '@/services'
86
 } from '@/services'
87
 
87
 
88
-import { maxDistanceKey } from '../../../backend/db/data-generator/config.json'
88
+import { distanceKey } from '../../../backend/db/data-generator/config.json'
89
 
89
 
90
 export default {
90
 export default {
91
     props: {
91
     props: {
248
                 Object.values(this.responseLikes),
248
                 Object.values(this.responseLikes),
249
             )
249
             )
250
             const maxDistanceRes = survey.find(
250
             const maxDistanceRes = survey.find(
251
-                res => res.response_key_id == maxDistanceKey,
251
+                res => res.response_key_id == distanceKey,
252
             )
252
             )
253
             /**
253
             /**
254
              * Creating a profile only returns the created
254
              * Creating a profile only returns the created

Загрузка…
Отмена
Сохранить