Add notification alias to document notifications endpoint output (#17028)

This commit is contained in:
Kenn Jacobsen
2024-09-17 10:58:47 +02:00
committed by Jacob Overgaard
parent d12dedb526
commit e6f379034f
3 changed files with 14 additions and 7 deletions

View File

@@ -27,13 +27,14 @@ internal sealed class DocumentNotificationPresentationFactory : IDocumentNotific
.ToArray()
?? Array.Empty<string>();
var availableActionIds = _actionCollection.Where(a => a.ShowInNotifier).Select(a => a.Letter.ToString()).ToArray();
return await Task.FromResult(
availableActionIds.Select(actionId => new DocumentNotificationResponseModel
return await Task.FromResult(_actionCollection
.Where(action => action.ShowInNotifier)
.Select(action => new DocumentNotificationResponseModel
{
ActionId = actionId,
Subscribed = subscribedActionIds.Contains(actionId)
}).ToArray());
ActionId = action.Letter,
Alias = action.Alias,
Subscribed = subscribedActionIds.Contains(action.Letter)
})
.ToArray());
}
}

View File

@@ -36279,6 +36279,7 @@
"DocumentNotificationResponseModel": {
"required": [
"actionId",
"alias",
"subscribed"
],
"type": "object",
@@ -36286,6 +36287,9 @@
"actionId": {
"type": "string"
},
"alias": {
"type": "string"
},
"subscribed": {
"type": "boolean"
}

View File

@@ -4,5 +4,7 @@ public class DocumentNotificationResponseModel
{
public required string ActionId { get; set; }
public required string Alias { get; set; }
public required bool Subscribed { get; set; }
}