From 188280488c4322e0eb72789a5e3762a09c43419c Mon Sep 17 00:00:00 2001 From: Soam Vasani Date: Sat, 10 Dec 2016 19:53:13 -0800 Subject: [PATCH] Fix bug in populating watch url --- controller/watchApi.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/controller/watchApi.go b/controller/watchApi.go index 34e4a4d9..329b833b 100644 --- a/controller/watchApi.go +++ b/controller/watchApi.go @@ -55,7 +55,14 @@ func (api *API) WatchApiCreate(w http.ResponseWriter, r *http.Request) { api.respondWithError(w, err) return } - watch.Url = fission.UrlForFunction(&watch.Function) + + function, err := api.FunctionStore.Get(&watch.Function) + if err != nil { + api.respondWithError(w, err) + return + } + + watch.Url = fission.UrlForFunction(&function.Metadata) uid, err := api.WatchStore.Create(&watch) if err != nil {