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] Added function to delete visitor data #45

Merged
merged 2 commits into from
Jan 7, 2019

Conversation

@@ -207,7 +207,8 @@ export default class Api extends EventEmitter {
if (!result) throw new Error(`API ${ method } ${ endpoint } result undefined`)
if (!this.success(result, ignore)) throw result
this.logger && this.logger.debug(`[API] ${method} ${endpoint} result ${result.status}`)
return (method === 'DELETE') ? result : result.data
const hasDataInsideResult = result && !result.data;

Choose a reason for hiding this comment

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

@MarcosSpessatto, just a suggestion, I would implement something like the statement below:

const { data } = result;
return (method === 'DELETE') && (data || result);

It's just a suggestion, your code is working fine as well.

@ggazzo ggazzo merged commit a5b6a21 into multiple-clients Jan 7, 2019
@ggazzo ggazzo deleted the feature/delete-visitor branch January 7, 2019 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants