mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Address review comments
This commit is contained in:
parent
a7a964ec19
commit
4de9e3598b
@ -189,6 +189,8 @@ Content-Type: application/json
|
|||||||
|
|
||||||
Updates one or more properties of an annotation that matches the specified id.
|
Updates one or more properties of an annotation that matches the specified id.
|
||||||
|
|
||||||
|
The `PATCH` operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties. It does not handle updating of the `isRegion` and `regionId` properties. To make an annotation regional or vice versa, consider using the `PUT` operation.
|
||||||
|
|
||||||
**Example Request**:
|
**Example Request**:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@ -198,8 +200,6 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"time":1507037197000,
|
|
||||||
"timeEnd":1507180807095,
|
|
||||||
"text":"New Annotation Description",
|
"text":"New Annotation Description",
|
||||||
"tags":["tag6","tag7","tag8"]
|
"tags":["tag6","tag7","tag8"]
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ func PatchAnnotation(c *m.ReqContext, cmd dtos.PatchAnnotationsCmd) Response {
|
|||||||
items, err := repo.Find(&annotations.ItemQuery{AnnotationId: annotationID, OrgId: c.OrgId})
|
items, err := repo.Find(&annotations.ItemQuery{AnnotationId: annotationID, OrgId: c.OrgId})
|
||||||
|
|
||||||
if err != nil || len(items) == 0 {
|
if err != nil || len(items) == 0 {
|
||||||
return Error(500, "Could not find annotation to update", err)
|
return Error(404, "Could not find annotation to update", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
existing := annotations.Item{
|
existing := annotations.Item{
|
||||||
|
@ -23,11 +23,11 @@ type UpdateAnnotationsCmd struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PatchAnnotationsCmd struct {
|
type PatchAnnotationsCmd struct {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Time int64 `json:"time"`
|
Time int64 `json:"time"`
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
TimeEnd int64 `json:"timeEnd"`
|
TimeEnd int64 `json:"timeEnd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteAnnotationsCmd struct {
|
type DeleteAnnotationsCmd struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user