Parcourir la source

:recycle: fixing up push to reveal on chat layout

tags/0.0.3^2
j il y a 3 ans
Parent
révision
e974471bae

+ 2
- 2
frontend/src/entities/grouping/grouping.js Voir le fichier

@@ -2,7 +2,7 @@
2 2
 
3 3
 import { _baseRecord } from '../index.js'
4 4
 import { groupingSchema } from './grouping.schema.js'
5
-// import { revealProfileInfo } from '../../services/profile.service.js'
5
+import { revealProfileInfo } from '../../services/profile.service.js'
6 6
 
7 7
 /** Class representing a grouping */
8 8
 class Grouping extends _baseRecord {
@@ -41,7 +41,7 @@ class Grouping extends _baseRecord {
41 41
         return [this.profile.profile_id]
42 42
     }
43 43
     async reveal(profileId, tagId) {
44
-        // return await revealProfileInfo(profileId, tagId)
44
+        return await revealProfileInfo(this.grouping_id, profileId, tagId)
45 45
     }
46 46
     /**
47 47
      * validate this record

+ 7
- 0
frontend/src/services/profile.service.js Voir le fichier

@@ -39,8 +39,15 @@ const fetchProfileByProfileId = async profileId => {
39 39
     return profile
40 40
 }
41 41
 
42
+const revealProfileInfo = async (groupingId, profileId, tagId) => {
43
+    const revealed = await db.post(
44
+        `/membership/${groupingId}/reveal?profile_id=${profileId}&tag_id=${tagId}`,
45
+    )
46
+    return revealed
47
+}
42 48
 export {
43 49
     fetchProfilesByUserId,
44 50
     fetchProfileByProfileId,
45 51
     createProfileForUserId,
52
+    revealProfileInfo,
46 53
 }

+ 7
- 2
frontend/src/views/ChatView.vue Voir le fichier

@@ -75,8 +75,13 @@ export default {
75 75
         currentProfile.chatter.setOnMessage(this._onMessage)
76 76
     },
77 77
     methods: {
78
-        reveal(tagId) {
79
-            this.grouping.reveal(currentProfile.profile_id, tagId)
78
+        async reveal(tagId) {
79
+            console.log('trying to reveal')
80
+            const thing = await this.grouping.reveal(
81
+                currentProfile.id.value,
82
+                tagId,
83
+            )
84
+            console.log('thing :>> ', thing)
80 85
         },
81 86
         /**
82 87
          * Pubnub message callback fires when message event

Chargement…
Annuler
Enregistrer