@@ -92,29 +92,30 @@ func ReplaceIndividualSubcription(c *gin.Context) {
9292 SuppFeat : util .StringToPtr (request .SuppFeat ),
9393 }
9494
95- if exists {
96- // Update existing subscription
97- bsfContext .BsfSelf .UpdateSubscription (subId , subscription )
98-
99- // Return updated subscription
100- response := models.BsfSubscriptionResp {
101- Events : subscription .Events ,
102- NotifUri : subscription .NotifUri ,
103- NotifCorreId : subscription .NotifCorreId ,
104- Supi : subscription .Supi ,
105- Gpsi : util .PtrToString (subscription .Gpsi ),
106- SnssaiDnnPairs : subscription .SnssaiDnnPairs ,
107- AddSnssaiDnnPairs : subscription .AddSnssaiDnnPairs ,
108- SuppFeat : util .PtrToString (subscription .SuppFeat ),
95+ if ! exists {
96+ problemDetail := models.ProblemDetails {
97+ Status : http .StatusNotFound ,
98+ Cause : "RESOURCE_NOT_FOUND" ,
10999 }
110- c .JSON (http .StatusOK , response )
111- } else {
112- // Create new subscription with given ID
113- subscription .SubId = subId
114- bsfContext .BsfSelf .Subscriptions [subId ] = subscription
100+ c .JSON (http .StatusNotFound , problemDetail )
101+ return
102+ }
115103
116- c .Status (http .StatusNoContent )
104+ // Update existing subscription
105+ bsfContext .BsfSelf .UpdateSubscription (subId , subscription )
106+
107+ // Return updated subscription
108+ response := models.BsfSubscriptionResp {
109+ Events : subscription .Events ,
110+ NotifUri : subscription .NotifUri ,
111+ NotifCorreId : subscription .NotifCorreId ,
112+ Supi : subscription .Supi ,
113+ Gpsi : util .PtrToString (subscription .Gpsi ),
114+ SnssaiDnnPairs : subscription .SnssaiDnnPairs ,
115+ AddSnssaiDnnPairs : subscription .AddSnssaiDnnPairs ,
116+ SuppFeat : util .PtrToString (subscription .SuppFeat ),
117117 }
118+ c .JSON (http .StatusOK , response )
118119}
119120
120121// DeleteIndividualSubcription handles DELETE /subscriptions/{subId}
0 commit comments