Commit ad5b16b6 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'add_empty_argument_to_due_date_issue_api' into 'master'

Issues api - allow empty due_date arg

See merge request gitlab-org/gitlab!39770
parents 60f6131e 4b92d729
......@@ -55,7 +55,7 @@ module API
desc: 'Return issues ordered by `created_at` or `updated_at` fields.'
optional :sort, type: String, values: %w[asc desc], default: 'desc',
desc: 'Return issues sorted in `asc` or `desc` order.'
optional :due_date, type: String, values: %w[0 overdue week month next_month_and_previous_two_weeks],
optional :due_date, type: String, values: %w[0 overdue week month next_month_and_previous_two_weeks] << '',
desc: 'Return issues that have no due date (`0`), or whose due date is this week, this month, between two weeks ago and next month, or which are overdue. Accepts: `overdue`, `week`, `month`, `next_month_and_previous_two_weeks`, `0`'
use :issues_stats_params
......
......@@ -404,6 +404,12 @@ RSpec.describe API::Issues do
travel_back
end
it 'returns them all when argument is empty' do
get api('/issues?due_date=', user)
expect_paginated_array_response(issue5.id, issue4.id, issue3.id, issue2.id, issue.id, closed_issue.id)
end
it 'returns issues without due date' do
get api('/issues?due_date=0', user)
......
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