Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-359

Removing tags or projects should update associated tasks

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.M5
    • Component/s: site
    • Labels:
      None

      Description

      If a tag or project is deleted, any tasks that have that project or tag associated with them should be updated. Then, the response should include an array of id's of tasks that were updated so that I can refresh those tasks on the client.

        Gliffy Diagrams

          Activity

          Hide
          kborchers Kris Borchers added a comment -

          For PUT on tag and project, please return a 200 instead of 204 with the updated record and an array of id's of linked tasks.

          Example:

          { "data": { "id": 2, ... }, "tasks": [1,4,5,7] }

          For DELETE on tag and project, return a 200 with just the array of linked tasks

          Example:

          { "tasks": [1,4,5,7] }

          Show
          kborchers Kris Borchers added a comment - For PUT on tag and project, please return a 200 instead of 204 with the updated record and an array of id's of linked tasks. Example: { "data": { "id": 2, ... }, "tasks": [1,4,5,7] } For DELETE on tag and project, return a 200 with just the array of linked tasks Example: { "tasks": [1,4,5,7] }
          Hide
          abstractj Bruno Oliveira added a comment - - edited

          Hi Kris, I didn't change the return from PUT, only DELETE, let me know if this is what you want and I can do the same for PUT. Also check the tag and projects removal, it should work know.

          My tests:

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title": "test", "style":"mydescription"}

          ' http://localhost:8080/todo-server/project/
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title": "test", "style":"mydescription"}

          ' http://localhost:8080/todo-server/project/

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"tag1","style":"fancy1"}

          ' http://localhost:8080/todo-server/tag/
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"tag2","style":"fancy2"}

          ' http://localhost:8080/todo-server/tag/
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"tag3","style":"fancy3"}

          ' http://localhost:8080/todo-server/tag/

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"Test POST1","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1}

          ' http://localhost:8080/todo-server/task
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"Test POST2","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1}

          ' http://localhost:8080/todo-server/task
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '

          {"title":"Test POST3","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1}

          ' http://localhost:8080/todo-server/task

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '

          {"title":"ta7","style":"fancy3"}

          ' http://localhost:8080/todo-server/tag/1

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/tag/
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/task/

          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/1
          curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/1

          Show
          abstractj Bruno Oliveira added a comment - - edited Hi Kris, I didn't change the return from PUT, only DELETE, let me know if this is what you want and I can do the same for PUT. Also check the tag and projects removal, it should work know. My tests: curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title": "test", "style":"mydescription"} ' http://localhost:8080/todo-server/project/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title": "test", "style":"mydescription"} ' http://localhost:8080/todo-server/project/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"tag1","style":"fancy1"} ' http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"tag2","style":"fancy2"} ' http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"tag3","style":"fancy3"} ' http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"Test POST1","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1} ' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"Test POST2","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1} ' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"Test POST3","date":"2012-08-08","description":"This is test data for abstractj :)","tags":[1,2], "project":1} ' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d ' {"title":"ta7","style":"fancy3"} ' http://localhost:8080/todo-server/tag/1 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/task/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/1 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/1

            People

            • Assignee:
              abstractj Bruno Oliveira
              Reporter:
              kborchers Kris Borchers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development