Ver código fonte

:bug: Fixed small bug in typeof conditional

tags/0.0.3^2
tomit4 3 anos atrás
pai
commit
4bf6327f0d

+ 3
- 3
backend/lib/services/profile/index.js Ver arquivo

@@ -355,8 +355,8 @@ module.exports = class ProfileService extends Schmervice.Service {
355 355
         await this._setTagLookup()
356 356
         let associations = groupingId
357 357
             ? await TagAssociation.query()
358
-                  .where('grouping_id', groupingId)
359
-                  .andWhere('profile_id', profileId)
358
+                .where('grouping_id', groupingId)
359
+                .andWhere('profile_id', profileId)
360 360
             : await TagAssociation.query().andWhere('profile_id', profileId)
361 361
         return associations
362 362
             .map(assoc => ({
@@ -388,7 +388,7 @@ module.exports = class ProfileService extends Schmervice.Service {
388 388
             await TagAssociation.query().insert(association)
389 389
             return await this.getTagsFor(association.profile_id)
390 390
         } else {
391
-            return console.error('tag association already exists')
391
+            return console.error('ERROR =>: tag association already exists')
392 392
         }
393 393
     }
394 394
 }

+ 2
- 2
backend/lib/services/profile/profiler.js Ver arquivo

@@ -35,8 +35,8 @@ class CompleteProfile {
35 35
         // BUG: If user reveals EITHER name or email, BOTH get revealed together...
36 36
         if (!this.reveal.length) {
37 37
             for (let [attribute, defaultVal] of Object.entries(defaultValues)) {
38
-                const typeOfReveal = this.reveal.find(tag => tag.tag_description === attribute)
39
-                if (typeOfReveal === undefined) {
38
+                const typeOfReveal = typeof this.reveal.find(tag => tag.tag_description === attribute)
39
+                if (typeOfReveal == 'undefined') {
40 40
                     this[attribute] = defaultVal
41 41
                 }
42 42
             }

Carregando…
Cancelar
Salvar