From 5d63f4dbec653167370be583b25b2d41c1d48826 Mon Sep 17 00:00:00 2001 From: chungchihhan Date: Fri, 12 Jul 2024 10:40:31 +0800 Subject: [PATCH 01/29] fix: fix the endpoint of upload files | SCRUM-72 --- src/app/ui/file-upload.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/ui/file-upload.tsx b/src/app/ui/file-upload.tsx index 5742b51..85f40b1 100644 --- a/src/app/ui/file-upload.tsx +++ b/src/app/ui/file-upload.tsx @@ -44,7 +44,7 @@ export default function FileUpload({ try { const response = await fetch( - "https://sojek1stci.execute-api.ap-northeast-1.amazonaws.com/dev/upload-multiple-file", + "https://api.tpet.awseducate.systems/dev/upload-multiple-file", { method: "POST", body: formData, From fd245e7ff99cea52d5058ae7b2d5fc443debdab3 Mon Sep 17 00:00:00 2001 From: chungchihhan Date: Fri, 12 Jul 2024 10:44:11 +0800 Subject: [PATCH 02/29] fix: fix the endpoint of list files | SCRUM-72 --- src/app/ui/select-dropdown.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/ui/select-dropdown.tsx b/src/app/ui/select-dropdown.tsx index 519829d..caf5dfb 100644 --- a/src/app/ui/select-dropdown.tsx +++ b/src/app/ui/select-dropdown.tsx @@ -65,8 +65,7 @@ export default function SelectDropdown({ const fetchFiles = async (file_extension: string, limit: number) => { try { setIsLoading(true); - const base_url = - "https://8um2zizr80.execute-api.ap-northeast-1.amazonaws.com/dev"; + const base_url = "https://api.tpet.awseducate.systems/dev"; const url = new URL(`${base_url}/files`); url.searchParams.append("file_extension", file_extension); url.searchParams.append("limit", limit.toString()); From 3b2652e8662f6a49c09691581a4eaf4e9a0060cb Mon Sep 17 00:00:00 2001 From: chungchihhan Date: Fri, 12 Jul 2024 10:55:00 +0800 Subject: [PATCH 03/29] refactor: rewrite the api endpoint of upload files | SCURM-72 --- src/app/ui/file-upload.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/ui/file-upload.tsx b/src/app/ui/file-upload.tsx index 85f40b1..c9a775c 100644 --- a/src/app/ui/file-upload.tsx +++ b/src/app/ui/file-upload.tsx @@ -43,13 +43,12 @@ export default function FileUpload({ setIsSubmitting(true); try { - const response = await fetch( - "https://api.tpet.awseducate.systems/dev/upload-multiple-file", - { - method: "POST", - body: formData, - } - ); + const base_url = "https://api.tpet.awseducate.systems/dev"; + const url = new URL(`${base_url}/upload-multiple-file`); + const response = await fetch(url.toString(), { + method: "POST", + body: formData, + }); if (!response.ok) { const errorMessage = `Upload failed: ${response.status} - ${response.statusText}`; From 1d8b321e080442229f7370a8ac031bbce320ec98 Mon Sep 17 00:00:00 2001 From: chungchihhan Date: Fri, 12 Jul 2024 11:09:04 +0800 Subject: [PATCH 04/29] fix: fix the endpoint of send emails | SCRUM-72 --- src/lib/actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/actions.ts b/src/lib/actions.ts index 83627f0..5dd5ccd 100644 --- a/src/lib/actions.ts +++ b/src/lib/actions.ts @@ -26,8 +26,10 @@ export async function submitForm(formData: FormData) { } try { console.log("data", data.data); + const base_url = "https://api.tpet.awseducate.systems/dev"; + const url = new URL(`${base_url}/send-email`); const response = await fetch( - "https://xtbr94xbt7.execute-api.ap-northeast-2.amazonaws.com/dev/send-email", + url.toString(), { method: "POST", headers: { From d3e230dc4ce1d2c960dccb413bebb9bcf5d244ce Mon Sep 17 00:00:00 2001 From: chungchihhan Date: Wed, 26 Jun 2024 15:31:39 +0800 Subject: [PATCH 05/29] feat: add a preview for xlsx file | SCRUM-62 --- src/app/ui/iframe-preview.tsx | 27 +++++++++++++++++++ src/app/ui/send-email-form.tsx | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/app/ui/iframe-preview.tsx diff --git a/src/app/ui/iframe-preview.tsx b/src/app/ui/iframe-preview.tsx new file mode 100644 index 0000000..6b4bdcd --- /dev/null +++ b/src/app/ui/iframe-preview.tsx @@ -0,0 +1,27 @@ +import React from "react"; + +interface IframePreviewProps { + src: string; + title: string; + width: string; + height: string; +} + +export default function IframePreview({ + src, + title, + width, + height, +}: IframePreviewProps) { + return ( +
+