members-api-integration #3

Merged
Ajdj100 merged 5 commits from members-api-integration into master 2024-05-26 10:53:57 -05:00
Showing only changes of commit ec61da96d7 - Show all commits

View File

@@ -50,23 +50,32 @@ export default {
},
filterByRole(item) { //THIS IS NOT IMPLEMENTED YET
return true;
}
},
},
components: {
Icon,
Dropdown,
},
mounted() {
// QueryApolloGraphQL("getPageViewMemberRankStatusAll", "query Query {getPageViewMemberRankStatusAll {items {member_name,rank,status}}}").then(value => { this.items = value }) //console.log(value); for debug reasons
// QueryApolloGraphQL("getPageViewMemberRankStatusAll", "query Query {getPageViewMemberRankStatusAll {items {member_name,rank,status}}}").then(value => { this.items = value }) //console.log(value); for debug reasons
// 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: {
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;
},
}
@@ -85,12 +94,12 @@ export default {
class="mx-2 max-w-md" />
<div id="dropdownWrapper">
<Dropdown :values="statusFilters" :currentIndex="currentStatusFilterIndex" display="name"
@changeSelection="(index) => currentStatusFilterIndex = index" class="w-36 mr-2">
<Dropdown :values="statusFilters" :currentIndex="currentStatusFilterIndex" display="name"
@changeSelection="(index) => currentStatusFilterIndex = index" class="w-36 mr-2">
</Dropdown>
<Dropdown :values="roleFilters" :currentIndex="currentRoleFilter" display="name"
@changeSelection="(index) => currentRoleFilter = index" class="w-36">
@changeSelection="(index) => currentRoleFilter = index" class="w-36">
</Dropdown>
<button @click="resetFilters()"
@@ -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>