fix api name

develop
Morisse 6 years ago
parent dee3607bae
commit 5a641a0278
  1. 6
      src/BooleanRow.js
  2. 30
      src/DataToTable.js
  3. 4
      src/UserRightPanel.js

@ -20,7 +20,11 @@ export default class BooleanRow extends Component {
row = <Glyphicon glyph = 'remove' className='falseBoolean' />;
}
} else {
row = <Glyphicon glyph = 'remove' />;
if (this.props.value) {
row = <Glyphicon glyph = 'ok' />;
} else {
row = <Glyphicon glyph = 'remove' />;
}
}
return (

@ -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',

@ -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: {

Loading…
Cancel
Save