Skip to content

Commit

Permalink
Update MediaController
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjanwestendorp authored and emmagarland committed Oct 6, 2023
1 parent cd28556 commit 7aa246b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,13 @@ public PagedResult<ContentItemBasic<ContentPropertyBasic>> GetChildren(int id,
IQuery<IMedia>? queryFilter = null;
if (filter.IsNullOrWhiteSpace() == false)
{
int.TryParse(filter, out int filterAsIntId);
Guid.TryParse(filter, out Guid filterAsGuid);
//add the default text filter
queryFilter = _sqlContext.Query<IMedia>()
.Where(x => x.Name != null)
.Where(x => x.Name!.Contains(filter));
.Where(x => x.Name!.Contains(filter)
|| x.Id == filterAsIntId || x.Key == filterAsGuid);
}

children = _mediaService
Expand Down

0 comments on commit 7aa246b

Please sign in to comment.