Skip to content

Commit

Permalink
Update base.js
Browse files Browse the repository at this point in the history
  • Loading branch information
r350178982 committed Dec 20, 2023
1 parent 1cfde00 commit 2de6e19
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Base {
}

getDTable() {
const url = `dtables/${this.dtableUuid}/?lang=${this.lang}`;
const url = `/dtables/${this.dtableUuid}/?lang=${this.lang}`;
return this.req.get(url);
}

Expand All @@ -91,6 +91,7 @@ class Base {
return this.req.get(url);
}


addTable(table_name, lang) {
const url = `/api/v1/dtables/${this.dtableUuid}/tables/`;
const data = {
Expand Down Expand Up @@ -383,8 +384,8 @@ class Base {
const url = `api/v1/dtables/${this.dtableUuid}/links/`;
const data = {
link_id: link_id,
table_id: table_id,
other_table_id: other_table_id,
table_name: table_id,
other_table_name: other_table_id,
row_id: row_id,
other_rows_ids: other_rows_ids,
};
Expand Down Expand Up @@ -415,7 +416,8 @@ class Base {
return this.req.put(url, {...data});
}

getColumnLinkId(columns, column_name) {
async getColumnLinkId(table_name, column_name) {
const columns = await this.listColumns(table_name);
const column = columns.find(column => column.name === column_name);
if (!column) {
return Promise.reject({error_message: 'column is not exist',});
Expand Down

0 comments on commit 2de6e19

Please sign in to comment.