Blog düzeltme
This commit is contained in:
parent
d0d255f41e
commit
0eaf281dcf
2 changed files with 7 additions and 10 deletions
|
|
@ -40,12 +40,9 @@ namespace Kurs.Platform.Blog
|
|||
|
||||
var filtered = allPosts.Where(post =>
|
||||
{
|
||||
var localizedTitle = _localizer[post.Title].Value;
|
||||
var localizedSummary = _localizer[post.Summary].Value;
|
||||
|
||||
var searchMatch = string.IsNullOrWhiteSpace(input.Search) ||
|
||||
localizedTitle.Contains(input.Search, StringComparison.OrdinalIgnoreCase) ||
|
||||
localizedSummary.Contains(input.Search, StringComparison.OrdinalIgnoreCase);
|
||||
post.ContentTr.Contains(input.Search, StringComparison.OrdinalIgnoreCase) ||
|
||||
post.ContentEn.Contains(input.Search, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var categoryMatch = !input.CategoryId.HasValue || post.CategoryId == input.CategoryId.Value;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ const BlogManagement = () => {
|
|||
blogService.getPosts({ pageSize: 100 }),
|
||||
blogService.getCategories(),
|
||||
])
|
||||
setCategories(categoriesData.filter((a) => a.name.startsWith('blog')))
|
||||
setPosts(postsData.items.filter((a) => a.title.startsWith('blog')))
|
||||
setCategories(categoriesData)
|
||||
setPosts(postsData.items)
|
||||
} catch (error) {
|
||||
toast.push(
|
||||
<Notification title="Hata" type="danger">
|
||||
|
|
@ -558,7 +558,7 @@ const BlogManagement = () => {
|
|||
? Object.entries(texts.Platform).map(([key, value]) => ({
|
||||
value: key,
|
||||
label: value + ' (' + key + ')',
|
||||
}))
|
||||
})).filter(a=> a.value.startsWith("blog"))
|
||||
: []
|
||||
|
||||
return (
|
||||
|
|
@ -596,7 +596,7 @@ const BlogManagement = () => {
|
|||
? Object.entries(texts.Platform).map(([key, value]) => ({
|
||||
value: key,
|
||||
label: value + ' (' + key + ')',
|
||||
}))
|
||||
})).filter(a=> a.value.startsWith("blog"))
|
||||
: []
|
||||
|
||||
return (
|
||||
|
|
@ -624,7 +624,7 @@ const BlogManagement = () => {
|
|||
<Select
|
||||
field={field}
|
||||
form={form}
|
||||
options={categoryItems}
|
||||
options={categoryItems.filter(a=> a.label.startsWith("blog"))}
|
||||
isClearable={true}
|
||||
value={categoryItems.filter((option) => option.value === values.categoryId)}
|
||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue