Add article unit lookup

This commit is contained in:
2026-06-07 14:37:51 +02:00
parent 8ac9b1e58a
commit a5608ab461
9 changed files with 53 additions and 4 deletions
+14
View File
@@ -318,6 +318,20 @@ class AgrarmonitorConnector {
};
});
}
async getArtikelEinheiten() {
const response = await this.http.get('/artikel/einheiten');
await this.saveSession();
const document = this.parseHtmlDocument(response.data);
const rows = Array.from(document.querySelectorAll('table#einheiten tbody tr'));
return rows.map(row => {
const cells = Array.from(row.querySelectorAll('td'));
return {
id: this.parseNumber(row.getAttribute('data-id') ?? row.id),
bezeichnung: cells[0]?.textContent?.trim() ?? '',
kurz: cells[1]?.textContent?.trim() ?? '',
};
});
}
createHttpClient() {
const client = (0, axios_cookiejar_support_1.wrapper)(axios_1.default.create({
baseURL: this.baseUrl,