| gio | 43e0aad | 2025-08-01 16:17:27 +0400 | [diff] [blame] | 1 | import { Machines, MachinesSchema } from "config"; |
| 2 | |||||
| 3 | export class MachineManager { | ||||
| 4 | constructor(private readonly apiAddr: string) {} | ||||
| 5 | |||||
| 6 | async getUserMachines(username: string): Promise<Machines> { | ||||
| 7 | const response = await fetch(`${this.apiAddr}/user/${username}/node`); | ||||
| 8 | return MachinesSchema.parse(await response.json()); | ||||
| 9 | } | ||||
| 10 | } | ||||