Let the add-printer form take every supported kind
A kind selector (Bambu, Klipper, PrusaLink, OctoPrint) decides which fields appear: serial and access code for Bambu, an API key for PrusaLink and OctoPrint, neither for Klipper. Discovered printers of any of these kinds now fill the form in.
This commit is contained in:
@@ -75,7 +75,7 @@ async function addPrinter(farmId: string, printer: NewPrinter) {
|
||||
try {
|
||||
await apiFetch(`/farms/${farmId}/printers`, {
|
||||
method: "POST",
|
||||
body: { ...printer, vendor: "bambu" },
|
||||
body: printer,
|
||||
});
|
||||
} catch (err) {
|
||||
throw new Error(apiErrorMessage(err, "the printer could not be added"));
|
||||
|
||||
Reference in New Issue
Block a user