Commit c6f2abc9 authored by Adam Hegyi's avatar Adam Hegyi

Add updated_at to todos API

parent 31372511
---
title: Expose the updated_at attribute in the todos API
merge_request: 30035
author:
type: changed
......@@ -101,7 +101,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "pending",
"created_at": "2016-06-17T07:52:35.225Z"
"created_at": "2016-06-17T07:52:35.225Z",
"updated_at": "2016-06-17T07:52:35.225Z"
},
{
"id": 98,
......@@ -174,7 +175,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "pending",
"created_at": "2016-06-17T07:49:24.624Z"
"created_at": "2016-06-17T07:49:24.624Z",
"updated_at": "2016-06-17T07:49:24.624Z"
}
]
```
......@@ -272,7 +274,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "done",
"created_at": "2016-06-17T07:52:35.225Z"
"created_at": "2016-06-17T07:52:35.225Z",
"updated_at": "2016-06-17T07:52:35.225Z"
}
```
......
......@@ -22,6 +22,7 @@ module API
expose :body
expose :state
expose :created_at
expose :updated_at
def todo_target_class(target_type)
# false as second argument prevents looking up in module hierarchy
......
......@@ -235,6 +235,7 @@ describe API::Todos do
expect(json_response['state']).to eq('pending')
expect(json_response['action_name']).to eq('marked')
expect(json_response['created_at']).to be_present
expect(json_response['updated_at']).to be_present
end
it 'returns 304 there already exist a todo on that issuable' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment