From b9c97e6e38b69e55bb5770a71ed05dbc79c9f8ee Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Thu, 14 Mar 2024 15:37:23 +0100 Subject: [PATCH] Fix endpoints --- src/app/services/crud.service.ts | 22 +++++++++---------- src/app/views/adapters/adapters.component.ts | 2 +- .../query-interfaces.component.ts | 2 +- .../edit-columns/edit-columns.component.ts | 6 ++--- .../edit-source-columns.component.ts | 2 +- src/app/views/uml/uml.component.ts | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app/services/crud.service.ts b/src/app/services/crud.service.ts index dcb1224a..fbecc5fe 100644 --- a/src/app/services/crud.service.ts +++ b/src/app/services/crud.service.ts @@ -217,8 +217,8 @@ export class CrudService { return this._http.post(`${this.httpUrl}/getMaterializedInfo`, materializedRequest, this.httpOptions); } - addColumn(columnRequest: ColumnRequest) { - return this._http.post(`${this.httpUrl}/addColumn`, columnRequest, this.httpOptions); + createColumn(columnRequest: ColumnRequest) { + return this._http.post(`${this.httpUrl}/createColumn`, columnRequest, this.httpOptions); } dropColumn(columnRequest: ColumnRequest) { @@ -274,15 +274,15 @@ export class CrudService { /** * Add a primary key to a table */ - addPrimaryKey(request: ConstraintRequest) { - return this._http.post(`${this.httpUrl}/addPrimaryKey`, request, this.httpOptions); + createPrimaryKey(request: ConstraintRequest) { + return this._http.post(`${this.httpUrl}/createPrimaryKey`, request, this.httpOptions); } /** * Add a unique constraint to a table */ - addUniqueConstraint(request: ConstraintRequest) { - return this._http.post(`${this.httpUrl}/addUniqueConstraint`, request, this.httpOptions); + createUniqueConstraint(request: ConstraintRequest) { + return this._http.post(`${this.httpUrl}/createUniqueConstraint`, request, this.httpOptions); } /** @@ -453,8 +453,8 @@ export class CrudService { /** * Add a foreign key (in the Uml view) */ - addForeignKey(fk: ForeignKey) { - return this._http.post(`${this.httpUrl}/addForeignKey`, fk, this.httpOptions); + createForeignKey(fk: ForeignKey) { + return this._http.post(`${this.httpUrl}/createForeignKey`, fk, this.httpOptions); } /** @@ -528,7 +528,7 @@ export class CrudService { return this._http.get(`${this.httpUrl}/getAvailableSources`); } - addAdapter(adapter: AdapterModel) { + createAdapter(adapter: AdapterModel) { return this._http.post(`${this.httpUrl}/createAdapter`, adapter, this.httpOptions); } @@ -549,8 +549,8 @@ export class CrudService { return this._http.get(`${this.httpUrl}/getAvailableQueryInterfaces`); } - addQueryInterface(request: any) { - return this._http.post(`${this.httpUrl}/addQueryInterface`, request, this.httpOptions); + createQueryInterface(request: any) { + return this._http.post(`${this.httpUrl}/createQueryInterface`, request, this.httpOptions); } updateQueryInterfaceSettings(request: QueryInterface) { diff --git a/src/app/views/adapters/adapters.component.ts b/src/app/views/adapters/adapters.component.ts index 6113438d..802714da 100644 --- a/src/app/views/adapters/adapters.component.ts +++ b/src/app/views/adapters/adapters.component.ts @@ -403,7 +403,7 @@ export class AdaptersComponent implements OnInit, OnDestroy { private startDeploying(deploy: AdapterModel) { this.deploying = true; - this._crud.addAdapter(deploy).subscribe({ + this._crud.createAdapter(deploy).subscribe({ next: (result: RelationalResult) => { if (!result.error) { this._toast.success('Deployed "' + deploy.name + '"', result.query); diff --git a/src/app/views/query-interfaces/query-interfaces.component.ts b/src/app/views/query-interfaces/query-interfaces.component.ts index d5c0a1eb..83621b08 100644 --- a/src/app/views/query-interfaces/query-interfaces.component.ts +++ b/src/app/views/query-interfaces/query-interfaces.component.ts @@ -198,7 +198,7 @@ export class QueryInterfacesComponent implements OnInit, OnDestroy { for (const [k, v] of Object.entries(this.editingAvailableQIForm.controls)) { deploy.currentSettings[k] = v.value; } - this._crud.addQueryInterface(deploy).subscribe({ + this._crud.createQueryInterface(deploy).subscribe({ next: res => { const result = res; if (!result.error) { diff --git a/src/app/views/schema-editing/edit-columns/edit-columns.component.ts b/src/app/views/schema-editing/edit-columns/edit-columns.component.ts index b15cfc24..9116978b 100644 --- a/src/app/views/schema-editing/edit-columns/edit-columns.component.ts +++ b/src/app/views/schema-editing/edit-columns/edit-columns.component.ts @@ -445,7 +445,7 @@ export class EditColumnsComponent implements OnInit, OnDestroy { this.createColumn.scale = null; } const req = new ColumnRequest(this.entity().id, null, this.createColumn); - this._crud.addColumn(req).subscribe({ + this._crud.createColumn(req).subscribe({ next: (res: RelationalResult) => { if (res.error === undefined) { //this._catalog.updateIfNecessary(); @@ -535,7 +535,7 @@ export class EditColumnsComponent implements OnInit, OnDestroy { } }); const constraintRequest = new ConstraintRequest(this.entity().id, pk); - this._crud.addPrimaryKey(constraintRequest).subscribe({ + this._crud.createPrimaryKey(constraintRequest).subscribe({ next: (res: RelationalResult) => { if (!res.error) { this._toast.success('The primary key was updated.', res.query, 'updated primary key'); @@ -577,7 +577,7 @@ export class EditColumnsComponent implements OnInit, OnDestroy { return; } const constraintRequest = new ConstraintRequest(this.entity().id, constraint); - this._crud.addUniqueConstraint(constraintRequest).subscribe({ + this._crud.createUniqueConstraint(constraintRequest).subscribe({ next: (res: RelationalResult) => { if (!res.error) { //this._catalog.updateIfNecessary(); diff --git a/src/app/views/schema-editing/edit-source-columns/edit-source-columns.component.ts b/src/app/views/schema-editing/edit-source-columns/edit-source-columns.component.ts index d312b153..eac9c43c 100644 --- a/src/app/views/schema-editing/edit-source-columns/edit-source-columns.component.ts +++ b/src/app/views/schema-editing/edit-source-columns/edit-source-columns.component.ts @@ -175,7 +175,7 @@ export class EditSourceColumnsComponent implements OnInit, OnDestroy { addColumn(col: UiColumnDefinition, newName: string, newDefault: string) { const request = new ColumnRequest(this.entity().id, null, new UiColumnDefinition(-1, col.name, null, null, col.dataType, '', null, null, newDefault, -1, -1, newName)); - this._crud.addColumn(request).subscribe({ + this._crud.createColumn(request).subscribe({ next: res => { const result = res; if (result.error) { diff --git a/src/app/views/uml/uml.component.ts b/src/app/views/uml/uml.component.ts index 1dfdaba7..044d88d5 100644 --- a/src/app/views/uml/uml.component.ts +++ b/src/app/views/uml/uml.component.ts @@ -291,7 +291,7 @@ export class UmlComponent implements OnInit, AfterViewInit, OnDestroy { const fk: ForeignKey = new ForeignKey(-1, this.constraintName, this.schema, this.sourceTable, this.sourceCol, this.targetTable, this.targetCol) .updateAction(this.fkForm.value.update).deleteAction(this.fkForm.value.delete); - this._crud.addForeignKey(fk).subscribe({ + this._crud.createForeignKey(fk).subscribe({ next: res => { this.closeModal(); const result = res;