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

:recycle: fixing up push to reveal on chat layout

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

+ 2
- 2
frontend/src/entities/grouping/grouping.js Просмотреть файл

2
 
2
 
3
 import { _baseRecord } from '../index.js'
3
 import { _baseRecord } from '../index.js'
4
 import { groupingSchema } from './grouping.schema.js'
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
 /** Class representing a grouping */
7
 /** Class representing a grouping */
8
 class Grouping extends _baseRecord {
8
 class Grouping extends _baseRecord {
41
         return [this.profile.profile_id]
41
         return [this.profile.profile_id]
42
     }
42
     }
43
     async reveal(profileId, tagId) {
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
      * validate this record
47
      * validate this record

+ 7
- 0
frontend/src/services/profile.service.js Просмотреть файл

39
     return profile
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
 export {
48
 export {
43
     fetchProfilesByUserId,
49
     fetchProfilesByUserId,
44
     fetchProfileByProfileId,
50
     fetchProfileByProfileId,
45
     createProfileForUserId,
51
     createProfileForUserId,
52
+    revealProfileInfo,
46
 }
53
 }

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

75
         currentProfile.chatter.setOnMessage(this._onMessage)
75
         currentProfile.chatter.setOnMessage(this._onMessage)
76
     },
76
     },
77
     methods: {
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
          * Pubnub message callback fires when message event
87
          * Pubnub message callback fires when message event

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