Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

knrt10
Copy link
Contributor

@knrt10 knrt10 commented Jun 8, 2019

@renatobecker would you please review.

@reetp
Copy link

reetp commented Jun 13, 2019

Has any of this been looked at for GDPR compliance?
How is location obtained?
Is a user advised?
Can it be enabled/disabled?

@knrt10
Copy link
Contributor Author

knrt10 commented Jun 14, 2019

@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.

@reetp
Copy link

reetp commented Jun 14, 2019

@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,

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?

Copy link
Contributor Author

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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
getUserLocationByToken(token) {
findOneVisitorLocationByToken(token) {

return this.findOne(query);
}

saveLocationForUser(locationData) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
saveLocationForUser(locationData) {
saveVisitorLocation(data={}) {

saveLocationForUser(locationData) {
const { token, location } = locationData;

return this.insert({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return this.insert({
return this.upsert({

Copy link
Contributor Author

@knrt10 knrt10 Jun 23, 2019

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.

@@ -928,6 +928,14 @@ export const Livechat = {
});
});
},

checkUserLocation(token) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
checkUserLocation(token) {
getVisitorLocation(token) {

return LivechatSessions.getUserLocationByToken(token);
},

addUserLocationData(locationData) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
addUserLocationData(locationData) {
updateVisitorLocation(data={}) {

@engelgabriel
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants