Skip to content

Commit

Permalink
Fix endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Mar 14, 2024
1 parent 885a875 commit b9c97e6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions src/app/services/crud.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/adapters/adapters.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <RelationalResult>res;
if (!result.error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <RelationalResult>res;
if (result.error) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/uml/uml.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <RelationalResult>res;
Expand Down

0 comments on commit b9c97e6

Please sign in to comment.