[NEW] Livechat API to get and set location of user to database.#14765
[NEW] Livechat API to get and set location of user to database.#14765knrt10 wants to merge 2 commits intoRocketChat:developfrom
Conversation
|
Has any of this been looked at for GDPR compliance? |
|
@reetp I am looking into GDPR compliance and user will be notified. Regarding getting location, it is implemented on Livechat Client. Will be updating client PR for asking user permission and GDPR compliance. |
If stored the data must be removable from the database as well. |
| post() { | ||
| check(this.bodyParams, { | ||
| token: String, | ||
| location: Object, |
There was a problem hiding this comment.
Let's describe and check the whole location object structure, okay?
| super('livechat_sessions'); | ||
| } | ||
|
|
||
| getUserLocationByToken(token) { |
There was a problem hiding this comment.
| getUserLocationByToken(token) { | |
| findOneVisitorLocationByToken(token) { |
| return this.findOne(query); | ||
| } | ||
|
|
||
| saveLocationForUser(locationData) { |
There was a problem hiding this comment.
| saveLocationForUser(locationData) { | |
| saveVisitorLocation(data={}) { |
| saveLocationForUser(locationData) { | ||
| const { token, location } = locationData; | ||
|
|
||
| return this.insert({ |
There was a problem hiding this comment.
| return this.insert({ | |
| return this.upsert({ |
There was a problem hiding this comment.
I tried this but it is not working, throwing an error. Insert is working fine.
app/livechat/server/lib/Livechat.js
Outdated
| }); | ||
| }, | ||
|
|
||
| checkUserLocation(token) { |
There was a problem hiding this comment.
| checkUserLocation(token) { | |
| getVisitorLocation(token) { |
app/livechat/server/lib/Livechat.js
Outdated
| return LivechatSessions.getUserLocationByToken(token); | ||
| }, | ||
|
|
||
| addUserLocationData(locationData) { |
There was a problem hiding this comment.
| addUserLocationData(locationData) { | |
| updateVisitorLocation(data={}) { |
@renatobecker would you please review.