Skip to content

Commit

Permalink
(BE) Error handling for fetch document (#105)
Browse files Browse the repository at this point in the history
* Change fe env for dev mode

* Add exception handling for fetch document list
  • Loading branch information
devleejb authored Jan 25, 2024
1 parent b294943 commit 3765c17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
})
Expand Down Expand Up @@ -153,7 +155,9 @@ export class WorkspaceDocumentsService {
};
}

async findDocumentFromYorkie(documentKey: string): Promise<FindDocumentFromYorkieResponse> {
async findDocumentFromYorkie(
documentKey: string
): Promise<FindDocumentFromYorkieResponse | undefined> {
return new Promise((resolve, reject) => {
const client = connect(`${this.configService.get<string>("YORKIE_API_ADDR")}`);

Expand Down
4 changes: 2 additions & 2 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -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=""

0 comments on commit 3765c17

Please sign in to comment.