Commit c089660f authored by Ikram Haq's avatar Ikram Haq
Browse files

Add DELETE method in CAPIF API to delete the event subscriptions by its ID

parent c28481f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ func applicationsSubscriptionDELETE(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	vars := mux.Vars(r)
	subId := vars["subscriptionId"]
	appId := vars["appInstanceId"]
	appId := vars["subscriberId"]

	mutex.Lock()
	defer mutex.Unlock()
@@ -1153,7 +1153,7 @@ func applicationsSubscriptionDELETE(w http.ResponseWriter, r *http.Request) {
	}

	// Validate subscription
	if sub.Cfg.AppId != appId || sub.Cfg.Type != SER_AVAILABILITY_NOTIF_SUB_TYPE {
	if sub.Cfg.AppId != appId {
		err = errors.New("Subscription not found")
		log.Error(err.Error())
		errHandlerProblemDetails(w, err.Error(), http.StatusNotFound)
+7 −0
Original line number Diff line number Diff line
@@ -399,6 +399,13 @@ var routes = Routes{
		capifMgmt.ApplicationsSubscriptionsPUT,
	},

	Route{
		"ApplicationsSubscriptionDELETE",
		strings.ToUpper("Delete"),
		"/capif-events/v1/{subscriberId}/subscriptions/{subscriptionId}",
		svcMgmt.ApplicationsSubscriptionDELETE,
	},

	Route{
		"Index",
		"GET",