Add article unit lookup
This commit is contained in:
Vendored
+14
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user