Skip to content

Cannot update _User, _Role, _Product, _Installation, _Session via Schemas API #804

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

Closed
ntloc592 opened this issue Mar 3, 2016 · 10 comments
Closed

Comments

@ntloc592
Copy link

ntloc592 commented Mar 3, 2016

  • When I try to update _User, _Role, _Product, _Installation, _Session via Schemas API
  • Result:
    {
    "code": 136,
    "error": "field 'field name....' cannot be added"
    }
@drew-gross
Copy link
Contributor

This should be fixed by #797

@Marco129
Copy link
Contributor

Marco129 commented Mar 3, 2016

@drew-gross #797 did not fix this bug.
Perhaps is another problem in function buildMergedSchemaObjectof Schema.js

@drew-gross
Copy link
Contributor

OK, thanks for the heads up. Reopening.

@drew-gross
Copy link
Contributor

Merged #811

@ntloc592
Copy link
Author

ntloc592 commented Mar 4, 2016

I try to update system scheme with lasted version via Schemas API, but I can not do that

  • Result:
    {
    "code": 136,
    "error": "field 'field name....' cannot be added"
    }
  • In Schema.js
    • var sysSchemaField = Object.keys(defaultColumns).indexOf(mongoObject._id) === -1 ? [] : Object.keys(defaultColumns[mongoObject._id]);

==> This is not working with System schema.
==> 'mongoObject._id' is alway 'undefined', so 'sysSchemaField' is alway []

@drew-gross
Copy link
Contributor

Can you post the current contents of your _SCHEMA collection and a curl that demonstrates the issue? Also make sure you are using the latest version of Parse Server (2.1.4)

@drew-gross drew-gross reopened this Mar 4, 2016
@ntloc592
Copy link
Author

ntloc592 commented Mar 4, 2016

I make sure using lasted version 2.1.4
I try to update System Schema via API

  • http://localhost:1337/schemas/_User - POST method
  • JSON data post
    {
    "_ApplicationId": "appId",
    "_ClientVersion": "browser",
    "_MasterKey": "masterKey",
    "_InstallationId": "308310ea-6516-75bb-bcf7-3c85fbf0ec2f",
    "_method": "PUT",
    "className": "_User",
    "fields": {
    "test_system": {
    "type": "String"
    }
    }
    }
  • Result:
    {
    "code": 136,
    "error": "field username cannot be added"
    }

image

@Marco129
Copy link
Contributor

Marco129 commented Mar 4, 2016

Oh! My bad...
I assumed there will be a _id just like some of the test cases
Will provide bugfix PR asap

@ntloc592
Copy link
Author

ntloc592 commented Mar 4, 2016

Thanks for this work!

@drew-gross
Copy link
Contributor

Thanks for fixing the bug and adding tests @Marco129!

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

3 participants