integrated new API for fetching members
This commit is contained in:
@@ -50,7 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
filterByRole(item) { //THIS IS NOT IMPLEMENTED YET
|
filterByRole(item) { //THIS IS NOT IMPLEMENTED YET
|
||||||
return true;
|
return true;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Icon,
|
Icon,
|
||||||
@@ -61,12 +61,21 @@ export default {
|
|||||||
// this.items = fetch("http://iceberg-gaming.com:1323/api/members");
|
// this.items = fetch("http://iceberg-gaming.com:1323/api/members");
|
||||||
|
|
||||||
//make API request here
|
//make API request here
|
||||||
|
|
||||||
|
fetch('http://iceberg-gaming.com:1323/api/v1/member').then(res => {
|
||||||
|
console.log(res);
|
||||||
|
res.json().then(list => {
|
||||||
|
this.items = list;
|
||||||
|
console.log(this.items);
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filteredTable() {
|
filteredTable() {
|
||||||
var newTable = this.items;
|
var newTable = this.items;
|
||||||
newTable = newTable.filter(this.filterByUnit);
|
// newTable = newTable.filter(this.filterByUnit);
|
||||||
newTable = newTable.filter(this.filterByName);
|
// newTable = newTable.filter(this.filterByName);
|
||||||
return newTable;
|
return newTable;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -104,7 +113,7 @@ export default {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Member</th>
|
<th>Member</th>
|
||||||
<th>Unit</th>
|
<th>Status</th>
|
||||||
<th>Rank</th>
|
<th>Rank</th>
|
||||||
<th>Join Date</th>
|
<th>Join Date</th>
|
||||||
<th>LOA Until</th>
|
<th>LOA Until</th>
|
||||||
@@ -114,9 +123,12 @@ export default {
|
|||||||
<tbody id="tableBody">
|
<tbody id="tableBody">
|
||||||
<tr v-for="(item, index) in filteredTable"
|
<tr v-for="(item, index) in filteredTable"
|
||||||
v-on:click="$router.push({ path: `/profile/${item.member_name}/home` })">
|
v-on:click="$router.push({ path: `/profile/${item.member_name}/home` })">
|
||||||
<td>{{ item.member_name }}</td>
|
<td>{{ item.name }}</td>
|
||||||
<td>{{ item.status }}</td>
|
<td>{{ item.company }}</td>
|
||||||
<td>{{ item.rank }}</td>
|
<td>{{ item.rank.name }}</td>
|
||||||
|
<td>{{ item.created_at }}</td>
|
||||||
|
<td>hello</td>
|
||||||
|
<td>hello</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user