dharmafly / tasket

A micro-volunteering app, for crowd-managed tasks.
http://dharmafly.com/tasket
26 stars 3 forks source link

API bug: PUT response incorrect on archiving a hub #401

Closed premasagar closed 13 years ago

premasagar commented 13 years ago

On PUTting hub.archived to true, an incorrect response is sent back by the server:

On PUTting the following to /hubs/15:

{
    "title": "foo",
    "description": "",
    "image": "",
    "tasks": {
        "claimed": [],
        "new": [
            "9"
        ],
        "verified": [
            "5",
            "6",
            "8"
        ],
        "done": []
    },
    "estimates": {
        "claimed": 0,
        "new": 14400,
        "verified": 16200,
        "done": 0
    },
    "createdTime": 1311892257,
    "owner": "1",
    "id": "15",
    "archived": true
}

The server responds as follows:

{
    "updated": true,
    "id": "15",
    "hub": {
        "archived": {
            "timestamp": 1312864118,
            "archivedBy": "1"
        },
        "tasks": {
            "claimed": [],
            "new": [
                "9"
            ],
            "verified": [
                "5",
                "6",
                "8"
            ],
            "done": []
        },
        "description": "",
        "title": "foo",
        "estimates": {
            "claimed": 0,
            "new": 14400,
            "verified": 16200,
            "done": 0
        },
        "createdTime": 1311892257,
        "owner": "1",
        "id": "15"
    }
}

Expected (no updated property and no hub property):

{
    "title": "foo",
    "description": "",
    "image": "",
    "tasks": {
        "claimed": [],
        "new": [
            "9"
        ],
        "verified": [
            "5",
            "6",
            "8"
        ],
        "done": []
    },
    "estimates": {
        "claimed": 0,
        "new": 14400,
        "verified": 16200,
        "done": 0
    },
    "createdTime": 1311892257,
    "owner": "1",
    "id": "15",
    "archived": {
        "timestamp": 1312864118,
        "archivedBy": "1"
    }
}