feat: 最後量測時間
This commit is contained in:
@@ -143,6 +143,7 @@
|
||||
:error="physicalFitnessError"
|
||||
:items="physicalFitnessItems"
|
||||
:loading="physicalFitnessLoading"
|
||||
:received-at="physicalFitnessReceivedAt"
|
||||
@refresh="loadPhysicalFitness"
|
||||
/>
|
||||
|
||||
@@ -424,6 +425,7 @@ const generatePhysicalFitnessLoading = ref(false);
|
||||
const generateResult = ref("");
|
||||
const generateError = ref("");
|
||||
const physicalFitnessItems = ref<PhysicalFitnessItem[]>([]);
|
||||
const physicalFitnessReceivedAt = ref<string | null>(null);
|
||||
const physicalFitnessLoading = ref(false);
|
||||
const physicalFitnessError = ref("");
|
||||
const redirectingToLogin = ref(false);
|
||||
@@ -507,6 +509,7 @@ function getRequiredUserID(): string | null {
|
||||
async function loadPhysicalFitness() {
|
||||
if (!store.isLoggedIn) {
|
||||
physicalFitnessItems.value = [];
|
||||
physicalFitnessReceivedAt.value = null;
|
||||
physicalFitnessError.value = "";
|
||||
return;
|
||||
}
|
||||
@@ -520,7 +523,9 @@ async function loadPhysicalFitness() {
|
||||
physicalFitnessError.value = "";
|
||||
|
||||
try {
|
||||
physicalFitnessItems.value = await fetchPhysicalFitness(userID);
|
||||
const physicalFitnessResponse = await fetchPhysicalFitness(userID);
|
||||
physicalFitnessItems.value = physicalFitnessResponse.results;
|
||||
physicalFitnessReceivedAt.value = physicalFitnessResponse.ReceivedAt;
|
||||
updateTodayTimeString();
|
||||
} catch (error) {
|
||||
physicalFitnessError.value = getApiErrorMessage(
|
||||
|
||||
Reference in New Issue
Block a user