Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Should not overwrite _access if it is not provided in save request payload #38

Closed
carmenlau opened this issue May 25, 2016 · 0 comments
Closed
Assignees
Milestone

Comments

@carmenlau
Copy link
Contributor

carmenlau commented May 25, 2016

Origanal object:

{
    "_access": [
        {
            "level": "read",
            "public": true
        }
    ],
    "_created_at": "2016-04-28T08:14:16.531024Z",
    "_created_by": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
    "_id": "TailormTailorTranslation/2f596451-06a3-4cec-a7d5-f01df372ad5c",
    "_ownerID": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
    "_type": "record",
    "_updated_at": "2016-05-25T06:07:21.786447Z",
    "_updated_by": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
    "address": "Workshop Unit B, 9/F, Wah Wai Industrial Building, No 1-7 Wo Heung St, Fo Tan, Shatin, Hong Kong",
    "description": "1\n2\n3\n4\n5\n6\n\n7",
    "geolocation": {
        "$lat": 22.396428,
        "$lng": 114.109497,
        "$type": "geo"
    },
    "locale": "en-US",
    "page_name": "Carmen Eng",
    "tailor": {
        "$id": "TailormTailor/ff3b6121-ef79-4ce3-a483-2acc26e62d9a",
        "$type": "ref"
    }
}

Update curl:

curl 'http://api.tailorm.dev/record/save' -H 'Pragma: no-cache' -H 'Origin: http://portal.tailorm.dev' -H 'Accept-Encoding: gzip, deflate' -H 'X-Skygear-Access-Token: 3e0add12-f662-4ae3-9936-c5737024816b' -H 'Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'Referer: http://portal.tailorm.dev/details' -H 'Connection: keep-alive' -H 'X-Skygear-API-Key: tailorm-key' --data-binary '{"action":"record:save","api_key":"tailorm-key","access_token":"3e0add12-f662-4ae3-9936-c5737024816b","database_id":"_public","records":[{"_id":"TailormTailorTranslation/2f596451-06a3-4cec-a7d5-f01df372ad5c","page_name":"Carmen Eng","address":"Workshop Unit B, 9/F, Wah Wai Industrial Building, No 1-7 Wo Heung St, Fo Tan, Shatin, Hong Kong","tailor":{"$id":"TailormTailor/ff3b6121-ef79-4ce3-a483-2acc26e62d9a","$type":"ref"},"locale":"en-US"}]}' --compressed

Response:

{
    "result": [
        {
            "_access": null,
            "_created_at": "2016-04-28T08:14:16.531024Z",
            "_created_by": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
            "_id": "TailormTailorTranslation/2f596451-06a3-4cec-a7d5-f01df372ad5c",
            "_ownerID": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
            "_type": "record",
            "_updated_at": "2016-05-25T06:07:55.537599Z",
            "_updated_by": "f3c547cf-130d-41bc-bc31-64f29dcfc18a",
            "address": "Workshop Unit B, 9/F, Wah Wai Industrial Building, No 1-7 Wo Heung St, Fo Tan, Shatin, Hong Kong",
            "description": "1\n2\n3\n4\n5\n6\n\n7",
            "geolocation": {
                "$lat": 22.396428,
                "$lng": 114.109497,
                "$type": "geo"
            },
            "locale": "en-US",
            "page_name": "Carmen Eng",
            "tailor": {
                "$id": "TailormTailor/ff3b6121-ef79-4ce3-a483-2acc26e62d9a",
                "$type": "ref"
            }
        }
    ]
}
@royuen royuen added the Planned label Jun 29, 2016
@royuen royuen modified the milestones: 0.13, 0.14 Jun 29, 2016
@royuen royuen added Focus and removed Planned labels Jul 12, 2016
@royuen royuen assigned rickmak and cheungpat and unassigned rickmak Jul 12, 2016
@royuen royuen added Planned and removed Focus labels Jul 12, 2016
@royuen royuen added Focus and removed Planned labels Jul 20, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Jul 21, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Jul 21, 2016
rickmak pushed a commit that referenced this issue Jul 21, 2016
@rickmak rickmak closed this as completed Jul 21, 2016
@rickmak rickmak removed the In Review label Jul 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants