Commit 12dc6d6f authored by Ikram Haq's avatar Ikram Haq
Browse files

Fix issue in PUT method to update the CAPIF event subscription

parent aa336de5
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -940,21 +940,21 @@ func applicationsSubscriptionsPUT(w http.ResponseWriter, r *http.Request) {
	if updatedSub.NotificationDestination != "" {
	if updatedSub.NotificationDestination != "" {
		sub.Cfg.NotifyUrl = updatedSub.NotificationDestination
		sub.Cfg.NotifyUrl = updatedSub.NotificationDestination
	}
	}
	if updatedSub.RequestTestNotification {
	// if updatedSub.RequestTestNotification {
		sub.Cfg.RequestTestNotif = true
	// 	sub.Cfg.RequestTestNotif = true
	}
	// }
	// if updatedSub.RequestWebsocketUri {
	// if updatedSub.RequestWebsocketUri {
	// 	sub.Cfg.RequestWebsocketUri = true
	// 	sub.Cfg.RequestWebsocketUri = true
	// } else {
	// } else {
	// 	sub.Cfg.RequestWebsocketUri = false
	// 	sub.Cfg.RequestWebsocketUri = false
	// }
	// }
	// Update event filters if provided
	// Update event filters if provided
	if updatedSub.EventFilters != nil {
	// if updatedSub.EventFilters != nil {
		sub.Cfg.EventFilters = convertEventFiltersToStrings(updatedSub.EventFilters)
	// 	sub.Cfg.EventFilters = convertEventFiltersToStrings(updatedSub.EventFilters)
	}
	// }
	if updatedSub.Events != nil {
	// if updatedSub.Events != nil {
		sub.Cfg.CapifEvent = convertEventToStrings(updatedSub.Events)
	// 	sub.Cfg.CapifEvent = convertEventToStrings(updatedSub.Events)
	}
	// }
	// Update the subscription in the manager
	// Update the subscription in the manager
	err = subMgr.UpdateSubscription(sub)
	err = subMgr.UpdateSubscription(sub)
	if err != nil {
	if err != nil {