Skip to content

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

Closed

Description

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

Activity

  1. drew-gross commented on Mar 3, 2016

    @drew-gross
    Contributor

    This should be fixed by #797

  2. Marco129 commented on Mar 3, 2016

    @Marco129
    Contributor

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

  3. drew-gross commented on Mar 3, 2016

    @drew-gross
    Contributor

    OK, thanks for the heads up. Reopening.

  4. drew-gross commented on Mar 3, 2016

    @drew-gross
    Contributor

    Merged #811

  5. ntloc592 commented on Mar 4, 2016

    @ntloc592
    Author

    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 []

  6. drew-gross commented on Mar 4, 2016

    @drew-gross
    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)

  7. ntloc592 commented on Mar 4, 2016

    @ntloc592
    Author

    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

  8. Marco129 commented on Mar 4, 2016

    @Marco129
    Contributor

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

  9. ntloc592 commented on Mar 4, 2016

    @ntloc592
    Author

    Thanks for this work!

  10. drew-gross commented on Mar 4, 2016

    @drew-gross
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions