@@ -258,6 +258,7 @@ export async function PUT(request: NextRequest, { params }: RouteParams) {
258258 action : AuditAction . NOTIFICATION_UPDATED ,
259259 resourceType : AuditResourceType . NOTIFICATION ,
260260 resourceId : notificationId ,
261+ resourceName : subscription . notificationType ,
261262 actorName : session . user . name ?? undefined ,
262263 actorEmail : session . user . email ?? undefined ,
263264 description : `Updated ${ subscription . notificationType } notification subscription` ,
@@ -313,12 +314,17 @@ export async function DELETE(request: NextRequest, { params }: RouteParams) {
313314 eq ( workspaceNotificationSubscription . workspaceId , workspaceId )
314315 )
315316 )
316- . returning ( { id : workspaceNotificationSubscription . id } )
317+ . returning ( {
318+ id : workspaceNotificationSubscription . id ,
319+ notificationType : workspaceNotificationSubscription . notificationType ,
320+ } )
317321
318322 if ( deleted . length === 0 ) {
319323 return NextResponse . json ( { error : 'Notification not found' } , { status : 404 } )
320324 }
321325
326+ const deletedSubscription = deleted [ 0 ]
327+
322328 logger . info ( 'Deleted notification subscription' , {
323329 workspaceId,
324330 subscriptionId : notificationId ,
@@ -332,7 +338,8 @@ export async function DELETE(request: NextRequest, { params }: RouteParams) {
332338 resourceId : notificationId ,
333339 actorName : session . user . name ?? undefined ,
334340 actorEmail : session . user . email ?? undefined ,
335- description : `Deleted notification subscription` ,
341+ resourceName : deletedSubscription . notificationType ,
342+ description : `Deleted ${ deletedSubscription . notificationType } notification subscription` ,
336343 request,
337344 } )
338345
0 commit comments