Skip to content

Commit

Permalink
Add notification alias to document notifications endpoint output (#17028
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kjac authored Sep 17, 2024
1 parent e9f75f0 commit 19c5711
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ public async Task<IEnumerable<DocumentNotificationResponseModel>> CreateNotifica
.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());
}
}
4 changes: 4 additions & 0 deletions src/Umbraco.Cms.Api.Management/OpenApi.json
Original file line number Diff line number Diff line change
Expand Up @@ -36551,13 +36551,17 @@
"DocumentNotificationResponseModel": {
"required": [
"actionId",
"alias",
"subscribed"
],
"type": "object",
"properties": {
"actionId": {
"type": "string"
},
"alias": {
"type": "string"
},
"subscribed": {
"type": "boolean"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}

0 comments on commit 19c5711

Please sign in to comment.