Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -115,6 +115,10 @@ export const useProductPricingStore = defineStore('product-pricing-store', {
|
||||
const nextCursorHeader = toText(res?.headers?.['x-next-cursor'])
|
||||
const data = Array.isArray(res?.data) ? res.data : []
|
||||
const mapped = data.map((x, i) => mapRow(x, i, baseIndex))
|
||||
const fallbackNextCursor = mapped.length > 0
|
||||
? toText(mapped[mapped.length - 1]?.productCode)
|
||||
: ''
|
||||
const nextCursor = nextCursorHeader || fallbackNextCursor
|
||||
if (append) {
|
||||
const merged = [...this.rows]
|
||||
const seen = new Set(this.rows.map((x) => x?.productCode))
|
||||
@@ -135,13 +139,13 @@ export const useProductPricingStore = defineStore('product-pricing-store', {
|
||||
row_count: this.rows.length,
|
||||
fetched_count: mapped.length,
|
||||
has_more: this.hasMore,
|
||||
next_cursor: nextCursorHeader || null
|
||||
next_cursor: nextCursor || null
|
||||
})
|
||||
return {
|
||||
traceId,
|
||||
fetched: mapped.length,
|
||||
hasMore: this.hasMore,
|
||||
nextCursor: nextCursorHeader
|
||||
nextCursor
|
||||
}
|
||||
} catch (err) {
|
||||
if (!append) this.rows = []
|
||||
|
||||
Reference in New Issue
Block a user