Agrarmonitor #2

Merged
bjoernpoettker merged 21 commits from Agrarmonitor into main 2026-05-25 11:02:59 +00:00
Showing only changes of commit 31d51dc19d - Show all commits
@@ -385,4 +385,17 @@ export class SettingsController {
return this.corrSettingRepo.save(setting);
}
// === Betriebe ===
@Get('clients')
async getClients() {
return this.clientRepo.find({ order: { Name: 'ASC' } });
}
@Put('clients/:id')
async updateClient(@Param('id') id: string, @Body() body: { AgrarmonitorBetriebId: number | null }) {
const clientId = parseInt(id, 10);
await this.clientRepo.update(clientId, { AgrarmonitorBetriebId: body.AgrarmonitorBetriebId ?? null });
return this.clientRepo.findOneByOrFail({ Id: clientId });
}
}