finished hooking up promotion history
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { BatchPromotion, BatchPromotionMember } from '@shared/schemas/promotionSchema';
|
||||
import { PagedData } from '@shared/types/pagination';
|
||||
import { PromotionSummary, Rank } from '@shared/types/rank'
|
||||
import { PromotionDetails, PromotionSummary, Rank } from '@shared/types/rank'
|
||||
|
||||
// @ts-ignore
|
||||
const addr = import.meta.env.VITE_APIHOST;
|
||||
@@ -60,8 +60,9 @@ export async function getPromoHistory(page?: number, pageSize?: number): Promise
|
||||
});
|
||||
}
|
||||
|
||||
export async function getPromotionsOnDay(day: Date): Promise<BatchPromotionMember[]> {
|
||||
const res = await fetch(`${addr}/memberRanks/${day}`, {
|
||||
export async function getPromotionsOnDay(day: Date): Promise<PromotionDetails[]> {
|
||||
console.log(day.toISOString());
|
||||
const res = await fetch(`${addr}/memberRanks/${day.toISOString()}`, {
|
||||
credentials: 'include',
|
||||
})
|
||||
|
||||
|
||||
@@ -71,8 +71,11 @@ function formatDate(date: Date): string {
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<div class="max-w-7xl w-full mx-auto">
|
||||
<div class="flex flex-col max-w-7xl w-full">
|
||||
<p class="scroll-m-20 text-2xl font-semibold tracking-tight mb-3">
|
||||
Promotion History
|
||||
</p>
|
||||
<div class="w-full mx-auto">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { getPromotionsOnDay } from '@/api/rank';
|
||||
import { BatchPromotionMember } from '@shared/schemas/promotionSchema';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import MemberCard from '../members/MemberCard.vue';
|
||||
import Spinner from '../ui/spinner/Spinner.vue';
|
||||
import { PromotionDetails } from '@shared/types/rank';
|
||||
|
||||
|
||||
const props = defineProps<{
|
||||
date: Date
|
||||
}>()
|
||||
|
||||
const promoList = ref<BatchPromotionMember[]>();
|
||||
const promoList = ref<PromotionDetails[]>();
|
||||
const loading = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -33,14 +33,14 @@ onMounted(async () => {
|
||||
|
||||
<tbody>
|
||||
<tr v-for="p in promoList" :key="p.member_id" class="border-b transition-colors">
|
||||
<td class="px-4 py-4">
|
||||
<td class="px-2 py-2">
|
||||
<MemberCard :member-id="p.member_id" />
|
||||
</td>
|
||||
<td class="px-4 py-4 text-sm">
|
||||
{{ p.rank_id }}
|
||||
<td class="px-4 py-2 text-sm">
|
||||
{{ p.short_name }}
|
||||
</td>
|
||||
<td class="px-4 py-4 text-sm text-right">
|
||||
guy1
|
||||
<td class="px-2 py-2 text-sm text-right">
|
||||
<MemberCard :member-id="p.created_by_id" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user