Add employee livesearch lookup
This commit is contained in:
Vendored
+23
@@ -369,6 +369,29 @@ class AgrarmonitorConnector {
|
||||
};
|
||||
});
|
||||
}
|
||||
async getMitarbeiter(suchstring = '', mitarbeitergruppe = 0) {
|
||||
const response = await this.http.get('/module/mitarbeiter/livesearch.php', {
|
||||
params: {
|
||||
suchstring,
|
||||
mitarbeiter_aktiv: 1,
|
||||
mitarbeitergruppe,
|
||||
itemsperpage: 100000,
|
||||
seite: 1,
|
||||
},
|
||||
});
|
||||
await this.saveSession();
|
||||
const document = this.parseHtmlDocument(response.data);
|
||||
const rows = Array.from(document.querySelectorAll('table#mitarbeiter_table tbody tr, table.mitarbeiter_table tbody tr'));
|
||||
return rows.map(row => {
|
||||
const cells = Array.from(row.querySelectorAll('td'));
|
||||
return {
|
||||
id: this.parseNumber(row.getAttribute('data-id') ?? row.id),
|
||||
nummer: cells[0]?.textContent?.trim() ?? '',
|
||||
nachname: cells[1]?.textContent?.trim() ?? '',
|
||||
vorname: cells[2]?.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