Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
8def73ba
Commit
8def73ba
authored
Jan 13, 2019
by
Sofia Papagiannaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Error 500 on unexisting /api/alert-notification/<id>
parent
8f5300dd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
pkg/api/alerting.go
+4
-0
pkg/api/alerting_test.go
+6
-0
No files found.
pkg/api/alerting.go
View file @
8def73ba
...
@@ -212,6 +212,10 @@ func GetAlertNotificationByID(c *m.ReqContext) Response {
...
@@ -212,6 +212,10 @@ func GetAlertNotificationByID(c *m.ReqContext) Response {
return
Error
(
500
,
"Failed to get alert notifications"
,
err
)
return
Error
(
500
,
"Failed to get alert notifications"
,
err
)
}
}
if
query
.
Result
==
nil
{
return
Error
(
404
,
"Alert notification not found"
,
nil
)
}
return
JSON
(
200
,
dtos
.
NewAlertNotification
(
query
.
Result
))
return
JSON
(
200
,
dtos
.
NewAlertNotification
(
query
.
Result
))
}
}
...
...
pkg/api/alerting_test.go
View file @
8def73ba
...
@@ -119,6 +119,12 @@ func TestAlertingApiEndpoint(t *testing.T) {
...
@@ -119,6 +119,12 @@ func TestAlertingApiEndpoint(t *testing.T) {
So
(
getAlertsQuery
.
Limit
,
ShouldEqual
,
5
)
So
(
getAlertsQuery
.
Limit
,
ShouldEqual
,
5
)
So
(
getAlertsQuery
.
Query
,
ShouldEqual
,
"alertQuery"
)
So
(
getAlertsQuery
.
Query
,
ShouldEqual
,
"alertQuery"
)
})
})
loggedInUserScenarioWithRole
(
"When calling GET on"
,
"GET"
,
"/api/alert-notifications/1"
,
"/alert-notifications/:notificationId"
,
m
.
ROLE_ADMIN
,
func
(
sc
*
scenarioContext
)
{
sc
.
handlerFunc
=
GetAlertNotificationByID
sc
.
fakeReqWithParams
(
"GET"
,
sc
.
url
,
map
[
string
]
string
{})
.
exec
()
So
(
sc
.
resp
.
Code
,
ShouldEqual
,
404
)
})
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment