Skip to content

Commit fe31866

Browse files
committed
Removal of required params for incidents routes
1 parent b4cc1f4 commit fe31866

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

src/data/resources/incidents.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class Incidents extends Base {
2222
/**
2323
* Returns a list of all open incidents
2424
*
25-
* @param {Object} [params] - example { status: 'open' }
26-
* Note: the status query parameter is required
25+
* @param {Object} [params] - example { status: 'open', severity: 'warning' }
2726
* @returns {Promise} - Returns a resolved Promise with a response from the Mux API
2827
*
2928
* @example
@@ -35,11 +34,6 @@ class Incidents extends Base {
3534
* @see https://api-docs.mux.com/#incident-get
3635
*/
3736
list(params) {
38-
if (!params || (params && !params.status)) {
39-
throw new Error(
40-
'The status query parameter is required for listing incidents.'
41-
);
42-
}
4337
return this.http.get(PATH, { params });
4438
}
4539

test/unit/data/resources/incidents.spec.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ describe('Unit::Incidents', () => {
4343
/** @test {Incidents.list} */
4444
describe('Incidents.list', () => {
4545
/** @test {Incidents.list} */
46-
it('throws an error if the status query parameter is not provided', () => {
47-
expect(() => incidentsInstance.list()).to.throw(
48-
'The status query parameter is required for listing incidents.'
49-
);
50-
expect(() => incidentsInstance.list({})).to.throw(
51-
'The status query parameter is required for listing incidents.'
52-
);
53-
});
54-
5546
it('makes a get request to the Mux data incidents route', done => {
5647
moxios.stubRequest('https://api.mux.com/data/v1/incidents?status=open', {
5748
status: 200,

0 commit comments

Comments
 (0)