Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuhaotc committed Dec 27, 2020
1 parent 0ff8cbf commit ce974e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CodeIndex.Common/SearchRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public record SearchRequest
public bool ForWeb { get; set; }
[MaxLength(32)]
public string CodePK { get; set; }
public bool IsEmpty => string.IsNullOrWhiteSpace(Content) && string.IsNullOrWhiteSpace(FileName) && string.IsNullOrWhiteSpace(FileExtension) && string.IsNullOrWhiteSpace(FilePath)
public bool IsEmpty => string.IsNullOrWhiteSpace(Content) && string.IsNullOrWhiteSpace(FileName) && string.IsNullOrWhiteSpace(FileExtension) && string.IsNullOrWhiteSpace(FilePath) && string.IsNullOrWhiteSpace(CodePK)
|| IndexPk == Guid.Empty;
}
}
1 change: 1 addition & 0 deletions src/CodeIndex.Server/Pages/SearchDetails.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/Details/{CodePK}/{IndexPK}"
@page "/Details/{CodePK}/{IndexPK}/{ContentQuery}"
@page "/Details/{CodePK}/{IndexPK}/{CaseSensitive:bool}/{PhaseQuery:bool}"
@page "/Details/{CodePK}/{IndexPK}/{ContentQuery}/{CaseSensitive:bool}/{PhaseQuery:bool}"
@inject HttpClient Client
@inject CodeIndexConfiguration Config
Expand Down
3 changes: 3 additions & 0 deletions src/CodeIndex.Test/Common/SearchRequestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public void TestConstructor()
request.FileExtension = " ";
request.FilePath = null;
request.FileName = null;
Assert.IsFalse(request.IsEmpty);

request.CodePK = null;
Assert.IsTrue(request.IsEmpty);
}
}
Expand Down

0 comments on commit ce974e2

Please sign in to comment.