From 5a641a02787631818f54458637c461261077ebe3 Mon Sep 17 00:00:00 2001 From: Morisse Date: Sun, 21 Oct 2018 06:37:35 +0200 Subject: [PATCH] fix api name --- src/BooleanRow.js | 6 +++++- src/DataToTable.js | 30 +++++------------------------- src/UserRightPanel.js | 4 ++-- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/BooleanRow.js b/src/BooleanRow.js index 1d42aa0..d1cc71e 100644 --- a/src/BooleanRow.js +++ b/src/BooleanRow.js @@ -20,7 +20,11 @@ export default class BooleanRow extends Component { row = ; } } else { - row = ; + if (this.props.value) { + row = ; + } else { + row = ; + } } return ( diff --git a/src/DataToTable.js b/src/DataToTable.js index 2099ee6..f732e9b 100644 --- a/src/DataToTable.js +++ b/src/DataToTable.js @@ -13,23 +13,13 @@ const tableType = // here we declare all the type of table we wish to display /* the primary key is the primary key corresponding to the sql db equivalent of our table, api is the synapse api which the table as json object*/ - 'primaryKey': 'User Id', 'apiAdress': '_matrix/client/r0/watchauserlist', + 'primaryKey': 'User Id', 'apiAdress': '_matrix/client/r0/watcha_user_list', /*if the table we want to display need data from more than one table we add JoinTables property to our dataObject matchingKey are the value that should match between the main table and the joining table, apiAdress is the synapse api adress for the joining table, column is the name of the column containing the value we are want to retrieve in the joining table*/ - 'JoinTables': { - 'watchadisplayname': { - 'matchingKey': { - 'mainTable': 'User Id', - 'secondaryTable': 'user_id', - }, - 'apiAdress': '_matrix/client/r0/watchadisplayname', - 'column': 'displayname', - }, - }, /*each header objects represent the title of a column in the table we display name being the name of te equivalent column in the db and type the type of data every JoinTables and only JoinTables must be of type list since we could have multiple value for a cell @@ -41,8 +31,8 @@ const tableType = // here we declare all the type of table we wish to display 'simplify': true, }, 'Display Name': { - 'name': 'watchadisplayname', - 'type': 'list', + 'name': 'displayname', + 'type': 'string', }, 'Email': { 'name': 'email', @@ -73,17 +63,7 @@ const tableType = // here we declare all the type of table we wish to display }, 'room': { 'primaryKey': 'Room Id', - 'apiAdress': '_matrix/client/r0/watchaextendroomlist', - 'JoinTables': { - 'watcharoomname': { - 'matchingKey': { - 'mainTable': 'Room Id', - 'secondaryTable': 'room_id', - }, - 'apiAdress': '_matrix/client/r0/watcharoomname', - 'column': 'name', - }, - }, + 'apiAdress': '_matrix/client/r0/watcha_extend_room_list', 'header': { 'Room Id': { 'name': 'room_id', @@ -91,7 +71,7 @@ const tableType = // here we declare all the type of table we wish to display 'simplify': true, }, 'Name': { - 'name': 'watcharoomname', 'type': 'list', + 'name': 'name', 'type': 'list', }, 'Creator': { 'name': 'creator', diff --git a/src/UserRightPanel.js b/src/UserRightPanel.js index e94f9ef..4e72154 100644 --- a/src/UserRightPanel.js +++ b/src/UserRightPanel.js @@ -65,7 +65,7 @@ export default class UserRightPanel extends Component { const accessToken = this.props.token; try { const userRequest - = await fetch(homeServer+ '_matrix/client/r0/watchaupdatemail/'+ + = await fetch(homeServer+ '_matrix/client/r0/watcha_update_email/'+ encodeURIComponent(this.props.data['User Id']['data']), { method: 'POST', headers: { @@ -104,7 +104,7 @@ export default class UserRightPanel extends Component { const accessToken = this.props.token; try { const userRequest - = await fetch(homeServer+ '_matrix/client/r0/watchaupdatepartnertomember/'+ + = await fetch(homeServer+ '_matrix/client/r0/watcha_update_partner_to_member/'+ encodeURIComponent(this.props.data['User Id']['data']), { method: 'PUT', headers: {