Initial commit

This commit is contained in:
payacom
2026-07-08 21:01:18 +03:30
parent 78decbba05
commit d2d3398471
1210 changed files with 9645 additions and 2522 deletions

View File

@@ -1,4 +1,5 @@
import { BASE_URL } from "@/components/main/BaseUrl";
import { normalizeUserLevel } from "@/lib/userLevel";
export async function fetchPosts(
page: number,
@@ -14,7 +15,12 @@ export async function fetchPosts(
},
token: string
) {
const validFilters = Object.entries(filters || {})
const normalizedFilters = { ...filters };
if (normalizedFilters.userLevel) {
normalizedFilters.userLevel = normalizeUserLevel(normalizedFilters.userLevel);
}
const validFilters = Object.entries(normalizedFilters || {})
.filter(([value]) => value !== undefined && value !== "")
.reduce((acc, [key, value]) => {
acc[key] = value;