-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Livechat API to get and set location of user to database. #14765
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's describe and check the whole location
object structure, okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
super('livechat_sessions'); | ||
} | ||
|
||
getUserLocationByToken(token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getUserLocationByToken(token) { | |
findOneVisitorLocationByToken(token) { |
return this.findOne(query); | ||
} | ||
|
||
saveLocationForUser(locationData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saveLocationForUser(locationData) { | |
saveVisitorLocation(data={}) { |
saveLocationForUser(locationData) { | ||
const { token, location } = locationData; | ||
|
||
return this.insert({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.insert({ | |
return this.upsert({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this but it is not working, throwing an error. Insert is working fine.
app/livechat/server/lib/Livechat.js
Outdated
@@ -928,6 +928,14 @@ export const Livechat = { | |||
}); | |||
}); | |||
}, | |||
|
|||
checkUserLocation(token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkUserLocation(token) { | |
getVisitorLocation(token) { |
app/livechat/server/lib/Livechat.js
Outdated
return LivechatSessions.getUserLocationByToken(token); | ||
}, | ||
|
||
addUserLocationData(locationData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addUserLocationData(locationData) { | |
updateVisitorLocation(data={}) { |
@renatobecker would you please review.