Fix build error
authorjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 21 Mar 2019 01:09:44 +0000 (10:09 +0900)
committerjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 21 Mar 2019 01:09:44 +0000 (10:09 +0900)
src/restapi/v1/restapi.go

index 1d59741..0e71cce 100644 (file)
@@ -107,6 +107,7 @@ func APIV1ServicemgrServicesServiceIDDelete(w http.ResponseWriter, r *http.Reque
                writeJSONResponse(w, smbytes, http.StatusOK)
        }
 }
+
 // APIV1ServicemgrEventServiceIDPost function
 func APIV1ServicemgrEventServiceIDPost(w http.ResponseWriter, r *http.Request) {
        log.Printf("[%s] APIV1ServicemgrEventServiceIDPost", logPrefix)
@@ -137,11 +138,11 @@ func APIV1ServicemgrServicesServiceIDPost(w http.ResponseWriter, r *http.Request
 
        vars := mux.Vars(r)
        serviceID := vars["serviceid"]
-       id, err := strconv.ParseUint(serviceID, 10, 64)
+       id, _ := strconv.ParseUint(serviceID, 10, 64)
 
-       exist, _ := servicemgr.ServiceNameMap.Get(id)
+       exist, _ := servicemgr.GetServiceName(id)
 
-       if exist == nil || err != nil {
+       if len(exist) != 0 {
                smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{Return: "NOTFOUND"})
                writeJSONResponse(w, smbytes, http.StatusBadRequest)
        } else {