This commit is contained in:
seb
2026-08-05 07:15:18 +02:00
parent b720c6ee25
commit d87047bfe3
2 changed files with 133 additions and 46 deletions

View File

@@ -183,6 +183,16 @@ async function httpGetBinary(path) {
return blob;
}
/**
* Company-scoped article search index (selectedCompanyId from session).
* GET /api/articleIndex → { articles: [...] }
*/
export const articleIndex = {
list() {
return http('/api/articleIndex');
},
};
export const article = {
search({ target, filter, offset, maxCount } = {}) {
const params = new URLSearchParams({ target });
@@ -512,12 +522,9 @@ export const brand = {
};
export const company = {
async list() {
try {
return await http('/api/company');
} catch {
return { companies: [] };
}
/** GET /api/company → { companies: [...] } */
list() {
return http('/api/company');
},
/** Uses GET /api/company until a dedicated endpoint exists. */
@@ -682,4 +689,14 @@ export const auth = {
},
};
export default { auth, article, brand, category, company, posterminal, thumb, unit };
export default {
auth,
article,
articleIndex,
brand,
category,
company,
posterminal,
thumb,
unit,
};