diff --git a/src/api/document.ts b/src/api/document.ts index 5f92111..a3cc4c7 100644 --- a/src/api/document.ts +++ b/src/api/document.ts @@ -2,7 +2,7 @@ import type { StorageFile } from '@/interface/response/storage' import config from "@/api"; export async function getDocumentList(volume: string, id: string) { - const res = await fetch(`${config.API_URI}/evaluation/document/${volume}/${id}`, { + const res = await fetch(`${config.API_URI}/document/${volume}/${id}`, { headers: { Accept: 'application/json', }, @@ -19,7 +19,7 @@ export async function getDocumentInfo( id: string, file: string ) { - const res = await fetch(`${config.API_URI}/evaluation/document/${volume}/${id}/${file}`, { + const res = await fetch(`${config.API_URI}/document/${volume}/${id}/${file}`, { headers: { Accept: 'application/json', }, diff --git a/src/api/index.ts b/src/api/index.ts index 40f3987..1e110a6 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -10,7 +10,7 @@ export const apiUrlConfig = import.meta.env.VITE_API_PUBLISH_URL const config = ref({ development: { // API_URI: "https://localhost:7260/api", - API_URI: 'https://bma-ehr.frappet.synology.me/api/v1', + API_URI: 'https://bma-ehr.frappet.synology.me/api/v1/evaluation', }, test: { API_URI: 'http://localhost:5010/api/v1', diff --git a/src/interface/response/storage.ts b/src/interface/response/storage.ts index b8d0c24..1db9eba 100644 --- a/src/interface/response/storage.ts +++ b/src/interface/response/storage.ts @@ -1,4 +1,4 @@ -export interface StorageFile { +interface StorageFile { pathname: string fileName: string @@ -17,4 +17,17 @@ export interface StorageFile { updatedBy: string createdAt: string | Date createdBy: string + author: string + metadata: MetadataObject } + +interface MetadataObject { + subject: string + author: string + position: string + additionalProp1: string + additionalProp3: string + additionalProp2: string +} + +export type { StorageFile, MetadataObject } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 93f4a34..6b1518e 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,12 +1,12 @@ @@ -40,17 +38,17 @@ onMounted(async () => {
ชื่อเรื่อง
-
{{ metadata?.additionalProp1 || data?.fileName }}
+
{{ metadata?.subject || data?.fileName }}
เจ้าของผลงาน
-
{{ metadata?.additionalProp2 || '-' }}
+
{{ metadata?.author || data?.author }}
ตำแหน่งที่ได้รับ
-
{{ metadata?.additionalProp3 || '-' }}
+
{{ metadata?.position || '-' }}