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

Removing locale from JSON response #1810

Open
rominai opened this issue Mar 25, 2023 · 1 comment
Open

Removing locale from JSON response #1810

rominai opened this issue Mar 25, 2023 · 1 comment

Comments

@rominai
Copy link

rominai commented Mar 25, 2023

Is it possible to remove locale from the nested JSON response when using sync or ANY other request? I saw some places saying I can set defaultLocale in createClient but it does not work.

I tried specifying it explicitly using:

    const syncOptions = {
      initial: init,
      limit: 20,
      resolveLinks: resolveLinks,
      nextSyncToken: dbNextSyncToken,
      locale: 'en-US',
    };

let syncResponse: SyncCollection = await this.client.sync(syncOptions);

But sadly I still get a JSON response that in order to access each element, I still have to go through:
x.y.z.'en-US' in order to get the value, is it possible to remove it so the en-US is present in every field of the JSON? I'm not using localization and I do not want it.

From the dashboard when I am going to locales I do not have the option to remove the tick from "Enable this locale in the response"
We are not using it at all, so how can I just get rid of it for now? thanks.

@rishabhkum-Dev-1799
Copy link

@rominai have you tried creating syncOptions without providing locale key ?

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

No branches or pull requests

2 participants