Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-18 17:31:53 +03:00
parent f8c0fe338a
commit 149cea778e
8 changed files with 505 additions and 7 deletions

View File

@@ -2441,7 +2441,9 @@ function scheduleReload () {
async function fetchChunk ({ page = 1, useCache = true } = {}) {
const filters = buildServerFilters()
const hasAnyFilter = Object.values(filters).some((v) => Array.isArray(v) && v.length > 0)
const productCodeCount = Array.isArray(filters.product_code) ? filters.product_code.length : 0
const hasPrimaryFilter = (filters.urun_ilk_grubu?.length || 0) > 0 || (filters.urun_ana_grubu?.length || 0) > 0
const hasNarrowProductFilter = productCodeCount > 0
if (!hasAnyFilter) {
// This endpoint is expensive without filters; require the user to scope down first.
store.rows = []
@@ -2452,7 +2454,7 @@ async function fetchChunk ({ page = 1, useCache = true } = {}) {
store.hasMore = false
return 0
}
if (!hasPrimaryFilter) {
if (!hasPrimaryFilter && !hasNarrowProductFilter) {
store.rows = []
store.error = GUIDANCE_MSG
store.totalCount = 0
@@ -2461,8 +2463,11 @@ async function fetchChunk ({ page = 1, useCache = true } = {}) {
store.hasMore = false
return 0
}
const effectiveLimit = hasNarrowProductFilter
? Math.max(productCodeCount, 1)
: PAGE_LIMIT
const result = await store.fetchRows({
limit: PAGE_LIMIT,
limit: effectiveLimit,
page,
append: false,
silent: false,