u
This commit is contained in:
@@ -30,15 +30,14 @@ export const article = {
|
||||
|
||||
/**
|
||||
* GET /api/article/history?offset=0&limit=50&search=...&seekMonths=-1
|
||||
* @param {{ offset?: number, limit?: number, search?: string, seekMonths?: number, startRow?: number, endRow?: number }} [params]
|
||||
* @param {{ offset?: number, limit?: number, search?: string, seekMonths?: number, sortModel?: Array, filterModel?: object }} [params]
|
||||
* → { history: ArticleHistoryEntry[], total: number, unfilteredTotal?: number }
|
||||
*/
|
||||
getHistory({ offset = 0, limit = 50, search, seekMonths, startRow, endRow, sortModel, filterModel } = {}) {
|
||||
// #region GET /api/article/history — getHistory
|
||||
getHistory({ offset = 0, limit = 50, search, seekMonths, sortModel, filterModel } = {}) {
|
||||
const params = new URLSearchParams();
|
||||
const finalOffset = offset != null ? offset : (startRow != null ? startRow : 0);
|
||||
const finalLimit = limit != null ? limit : (endRow != null && startRow != null ? endRow - startRow : 50);
|
||||
params.set('offset', String(Math.max(0, Math.floor(Number(finalOffset) || 0))));
|
||||
params.set('limit', String(Math.max(1, Math.floor(Number(finalLimit) || 50))));
|
||||
params.set('offset', String(Math.max(0, Math.floor(Number(offset) || 0))));
|
||||
params.set('limit', String(Math.max(1, Math.floor(Number(limit) || 50))));
|
||||
if (search && String(search).trim()) params.set('search', String(search).trim());
|
||||
if (seekMonths != null && Number(seekMonths) < 0) {
|
||||
params.set('seekMonths', String(Math.floor(Number(seekMonths))));
|
||||
@@ -48,6 +47,7 @@ export const article = {
|
||||
const qs = params.toString();
|
||||
return http(`/api/article/history${qs ? `?${qs}` : ''}`);
|
||||
},
|
||||
// #endregion
|
||||
|
||||
/**
|
||||
* GET /api/article/:sku/history
|
||||
|
||||
Reference in New Issue
Block a user