Skip to content

Commit

Permalink
Merge pull request #1202 from fdm-monster/fix/fdmm-2196-url-validatio…
Browse files Browse the repository at this point in the history
…n-before-printer-save

Fix/fdmm 2196 url validation before printer save
  • Loading branch information
davidzwa authored Apr 19, 2024
2 parents 25d7974 + 16fcf33 commit 78036b8
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 204 deletions.
6 changes: 6 additions & 0 deletions RELEASE_NOTES.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Client develop

# Client 18/04/2024 1.5.13

Features:

- Printer Create/Update: add URL and apiKey validation with feedback. When wanted force save can be used in case of failures.

# Client 18/04/2024 1.5.12

Fixes:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fdm-monster/client",
"version": "1.5.12",
"version": "1.5.13",
"author": "David Zwart",
"license": "AGPL-3.0-or-later",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions src/backend/printers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class PrintersService extends BaseService {
return await this.postApi(path, axes);
}

static async createPrinter(printer: CreatePrinter) {
const path = ServerApi.printerRoute;
static async createPrinter(printer: CreatePrinter, forceSave: boolean) {
const path = `${ServerApi.printerRoute}?forceSave=${forceSave}`;

return (await this.postApi(path, printer)) as PrinterDto;
}
Expand All @@ -103,10 +103,10 @@ export class PrintersService extends BaseService {
return await this.deleteApi(path);
}

static async updatePrinter(printerId: IdType, printer: CreatePrinter) {
static async updatePrinter(printerId: IdType, printer: CreatePrinter, forceSave: boolean) {
const path = ServerApi.getPrinterRoute(printerId);

return (await this.patchApi(path, printer)) as PrinterDto;
const fullPath = `${path}?forceSave=${forceSave}`;
return (await this.patchApi(fullPath, printer)) as PrinterDto;
}

static async updatePrinterMaintenance(printerId: IdType, disabledReason: string | null = null) {
Expand Down
Loading

0 comments on commit 78036b8

Please sign in to comment.