From 58258ccc07df933b214dd647da75de7ec6fbb521 Mon Sep 17 00:00:00 2001 From: devleejb Date: Thu, 25 Jan 2024 16:34:40 +0900 Subject: [PATCH 1/2] Change fe env for dev mode --- frontend/.env.development | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index be08dbc1..855fc6af 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,3 +1,3 @@ VITE_API_ADDR="http://localhost:3000" -VITE_YORKIE_API_ADDR="https://api.yorkie.dev" -VITE_YORKIE_API_KEY="cmftp10ksk14av0kc7gg" +VITE_YORKIE_API_ADDR="http://localhost:8080" +VITE_YORKIE_API_KEY="" From 3bfe4563761c6e87201e1e52c79338225a798656 Mon Sep 17 00:00:00 2001 From: devleejb Date: Thu, 25 Jan 2024 16:35:26 +0900 Subject: [PATCH 2/2] Add exception handling for fetch document list --- .../workspace-documents/workspace-documents.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/workspace-documents/workspace-documents.service.ts b/backend/src/workspace-documents/workspace-documents.service.ts index a32296ea..05d4dd52 100644 --- a/backend/src/workspace-documents/workspace-documents.service.ts +++ b/backend/src/workspace-documents/workspace-documents.service.ts @@ -79,7 +79,9 @@ export class WorkspaceDocumentsService { return this.findDocumentFromYorkie(doc.yorkieDocumentId).then((yorkieDoc) => { return { ...doc, - updatedAt: moment(yorkieDoc.document.updatedAt).toDate(), + updatedAt: yorkieDoc.document?.updatedAt + ? moment(yorkieDoc.document?.updatedAt).toDate() + : doc.updatedAt, }; }); }) @@ -153,7 +155,9 @@ export class WorkspaceDocumentsService { }; } - async findDocumentFromYorkie(documentKey: string): Promise { + async findDocumentFromYorkie( + documentKey: string + ): Promise { return new Promise((resolve, reject) => { const client = connect(`${this.configService.get("YORKIE_API_ADDR")}`);