Blog düzeltme

This commit is contained in:
Sedat Öztürk 2025-06-22 16:50:59 +03:00
parent d0d255f41e
commit 0eaf281dcf
2 changed files with 7 additions and 10 deletions

View file

@ -40,12 +40,9 @@ namespace Kurs.Platform.Blog
var filtered = allPosts.Where(post => var filtered = allPosts.Where(post =>
{ {
var localizedTitle = _localizer[post.Title].Value;
var localizedSummary = _localizer[post.Summary].Value;
var searchMatch = string.IsNullOrWhiteSpace(input.Search) || var searchMatch = string.IsNullOrWhiteSpace(input.Search) ||
localizedTitle.Contains(input.Search, StringComparison.OrdinalIgnoreCase) || post.ContentTr.Contains(input.Search, StringComparison.OrdinalIgnoreCase) ||
localizedSummary.Contains(input.Search, StringComparison.OrdinalIgnoreCase); post.ContentEn.Contains(input.Search, StringComparison.OrdinalIgnoreCase);
var categoryMatch = !input.CategoryId.HasValue || post.CategoryId == input.CategoryId.Value; var categoryMatch = !input.CategoryId.HasValue || post.CategoryId == input.CategoryId.Value;

View file

@ -87,8 +87,8 @@ const BlogManagement = () => {
blogService.getPosts({ pageSize: 100 }), blogService.getPosts({ pageSize: 100 }),
blogService.getCategories(), blogService.getCategories(),
]) ])
setCategories(categoriesData.filter((a) => a.name.startsWith('blog'))) setCategories(categoriesData)
setPosts(postsData.items.filter((a) => a.title.startsWith('blog'))) setPosts(postsData.items)
} catch (error) { } catch (error) {
toast.push( toast.push(
<Notification title="Hata" type="danger"> <Notification title="Hata" type="danger">
@ -558,7 +558,7 @@ const BlogManagement = () => {
? Object.entries(texts.Platform).map(([key, value]) => ({ ? Object.entries(texts.Platform).map(([key, value]) => ({
value: key, value: key,
label: value + ' (' + key + ')', label: value + ' (' + key + ')',
})) })).filter(a=> a.value.startsWith("blog"))
: [] : []
return ( return (
@ -596,7 +596,7 @@ const BlogManagement = () => {
? Object.entries(texts.Platform).map(([key, value]) => ({ ? Object.entries(texts.Platform).map(([key, value]) => ({
value: key, value: key,
label: value + ' (' + key + ')', label: value + ' (' + key + ')',
})) })).filter(a=> a.value.startsWith("blog"))
: [] : []
return ( return (
@ -624,7 +624,7 @@ const BlogManagement = () => {
<Select <Select
field={field} field={field}
form={form} form={form}
options={categoryItems} options={categoryItems.filter(a=> a.label.startsWith("blog"))}
isClearable={true} isClearable={true}
value={categoryItems.filter((option) => option.value === values.categoryId)} value={categoryItems.filter((option) => option.value === values.categoryId)}
onChange={(option) => form.setFieldValue(field.name, option?.value)} onChange={(option) => form.setFieldValue(field.name, option?.value)}