aboutsummaryrefslogtreecommitdiffstats
path: root/lib/apiv1/events.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 14:50:03 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 16:00:04 +0100
commitebf38065f8a0c0c3d1a3a7ce2a4caaaad712432c (patch)
tree00ca89c63f4ce48566202c6c32f76fe1ad3de4d3 /lib/apiv1/events.go
parent8d3f51e52894d46a4a92a944bc09f4ceaa1abf51 (diff)
Added short project ID name support if not ambiguous.
Diffstat (limited to 'lib/apiv1/events.go')
-rw-r--r--lib/apiv1/events.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/apiv1/events.go b/lib/apiv1/events.go
index 8f92ae0..9444262 100644
--- a/lib/apiv1/events.go
+++ b/lib/apiv1/events.go
@@ -122,11 +122,15 @@ func (s *APIService) eventsRegister(c *gin.Context) {
data := make(folder.EventCBData)
data["sid"] = sess.ID
- err := s.mfolders.RegisterEventChange(args.ProjectID, &cbFunc, &data)
+ prjID, err := s.mfolders.ResolveID(args.ProjectID)
if err != nil {
common.APIError(c, err.Error())
return
}
+ if err = s.mfolders.RegisterEventChange(prjID, &cbFunc, &data); err != nil {
+ common.APIError(c, err.Error())
+ return
+ }
c.JSON(http.StatusOK, gin.H{"status": "OK"})
}