Skip to content

Commit

Permalink
feat: use /api/board api instead of /api/zabo api.
Browse files Browse the repository at this point in the history
  • Loading branch information
jinho-choi123 committed Mar 22, 2024
1 parent 78c6b8b commit 5eb1ccd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## VITE_API_SERVER_URL should end without "/"
VITE_API_SERVER_URL=
VITE_ANIMATION_DURATION=
VITE_TRANSITION_INTERVAL=
VITE_TRANSITION_INTERVAL=

## put s3 url for initial content for zabo boards
VITE_INIT_CONTENT1=
VITE_INIT_CONTENT2=
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const API_SERVER_URL = import.meta.env.VITE_API_SERVER_URL;
export const ANIMATION_DURATION = import.meta.env.VITE_ANIMATION_DURATION;
export const TRANSITION_INTERVAL = import.meta.env.VITE_TRANSITION_INTERVAL;

export const INIT_CONTENT1 = import.meta.env.VITE_INIT_CONTENT1;
export const INIT_CONTENT2 = import.meta.env.VITE_INIT_CONTENT2;
6 changes: 3 additions & 3 deletions src/redux/zabos/fetchZaboThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const fetchZaboThunk = () => async (dispatch: AppDispatch) => {
// important thing is that, we have to set lastSeen params to get zabos after lastSeen
// so we can not do 5 requests in parallel. it should be sequential
let zabosData: ZaboJson[] = [];
for (let i = 0; i < 5; i += 1) {
for (let i = 0; i < 1; i += 1) {
const lastFetched =
zabosData.length > 0 ? zabosData[zabosData.length - 1].id : null;

// fetch zabos based on lastSeen(lastFetched)
const { data } =
lastFetched === null
? await axios.get("/api/zabo/list")
: await axios.get("/api/zabo/list", {
? await axios.get("/api/board/list")
: await axios.get("/api/board/list", {
params: {
lastSeen: lastFetched,
},
Expand Down

0 comments on commit 5eb1ccd

Please sign in to comment.