integrated new API for fetching members

This commit is contained in:
ajdj100
2024-05-26 10:03:39 -04:00
parent ffbf7ca23f
commit ec61da96d7

View File

@@ -50,7 +50,7 @@ export default {
},
filterByRole(item) { //THIS IS NOT IMPLEMENTED YET
return true;
}
},
},
components: {
Icon,
@@ -61,12 +61,21 @@ export default {
// this.items = fetch("http://iceberg-gaming.com:1323/api/members");
//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: {
filteredTable() {
var newTable = this.items;
newTable = newTable.filter(this.filterByUnit);
newTable = newTable.filter(this.filterByName);
// newTable = newTable.filter(this.filterByUnit);
// newTable = newTable.filter(this.filterByName);
return newTable;
},
}
@@ -104,7 +113,7 @@ export default {
<thead>
<tr>
<th>Member</th>
<th>Unit</th>
<th>Status</th>
<th>Rank</th>
<th>Join Date</th>
<th>LOA Until</th>
@@ -114,9 +123,12 @@ export default {
<tbody id="tableBody">
<tr v-for="(item, index) in filteredTable"
v-on:click="$router.push({ path: `/profile/${item.member_name}/home` })">
<td>{{ item.member_name }}</td>
<td>{{ item.status }}</td>
<td>{{ item.rank }}</td>
<td>{{ item.name }}</td>
<td>{{ item.company }}</td>
<td>{{ item.rank.name }}</td>
<td>{{ item.created_at }}</td>
<td>hello</td>
<td>hello</td>
</tr>
</tbody>
</table>