Refactor subscriber data src to check for errors
This commit is contained in:
parent
e43c9b88e9
commit
9655ce6f14
|
@ -762,7 +762,15 @@ class Subscribers extends React.PureComponent {
|
||||||
<Table
|
<Table
|
||||||
columns={this.columns}
|
columns={this.columns}
|
||||||
rowKey={record => `sub-${record.id}`}
|
rowKey={record => `sub-${record.id}`}
|
||||||
dataSource={this.props.data[cs.ModelSubscribers].results}
|
dataSource={(() => {
|
||||||
|
if (
|
||||||
|
!this.props.data[cs.ModelSubscribers] ||
|
||||||
|
!this.props.data[cs.ModelSubscribers].hasOwnProperty("results")
|
||||||
|
) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return this.props.data[cs.ModelSubscribers].results
|
||||||
|
})()}
|
||||||
loading={this.props.reqStates[cs.ModelSubscribers] !== cs.StateDone}
|
loading={this.props.reqStates[cs.ModelSubscribers] !== cs.StateDone}
|
||||||
pagination={pagination}
|
pagination={pagination}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
|
|
Loading…
Reference in New Issue