From 48a9a97e1877c22d6f289364d21a6382df7cf54e Mon Sep 17 00:00:00 2001
From: LittleSheep
Date: Fri, 19 Sep 2025 01:26:21 +0800
Subject: [PATCH] :recycle: Transformed API keys
---
app/components/AttachmentItem.vue | 2 +-
app/components/PostHeader.vue | 7 +--
app/composables/useSolarNetwork.ts | 22 +++++++-
app/pages/index.vue | 2 +-
app/types/api/activity.ts | 8 +--
app/types/api/post.ts | 70 +++++++++++++-------------
app/types/api/publisher.ts | 18 +++----
app/types/api/user.ts | 80 +++++++++++++++---------------
app/utils/transformKeys.ts | 57 +++++++++++++++++++++
9 files changed, 171 insertions(+), 95 deletions(-)
create mode 100644 app/utils/transformKeys.ts
diff --git a/app/components/AttachmentItem.vue b/app/components/AttachmentItem.vue
index ad47598..7f657c9 100644
--- a/app/components/AttachmentItem.vue
+++ b/app/components/AttachmentItem.vue
@@ -10,7 +10,7 @@ import type { SnAttachment } from '~/types/api'
const props = defineProps<{ item: SnAttachment }>()
-const itemType = computed(() => props.item.mime_type.split('/')[0] ?? 'unknown')
+const itemType = computed(() => props.item.mimeType.split('/')[0] ?? 'unknown')
const apiBase = useSolarNetworkUrl();
const remoteSource = computed(() => `${apiBase}/drive/files/${props.item.id}?original=true`)
diff --git a/app/components/PostHeader.vue b/app/components/PostHeader.vue
index 18608ab..d82d038 100644
--- a/app/components/PostHeader.vue
+++ b/app/components/PostHeader.vue
@@ -7,9 +7,9 @@
@{{ props.item.publisher.name }}
- {{ DateTime.fromISO(props.item.created_at).toRelative() }}
+ {{ DateTime.fromISO(props.item.createdAt).toRelative() }}
ยท
- {{ DateTime.fromISO(props.item.created_at).toLocaleString() }}
+ {{ DateTime.fromISO(props.item.createdAt).toLocaleString() }}
@@ -18,8 +18,9 @@