-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
enhancement/#4/setting
- Loading branch information
Showing
5 changed files
with
158 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
const baseUrl = "https://backend.ddudutodo.site/api/v1/challenges"; | ||
|
||
const cache = [ | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
{ | ||
name: "자전거로 출근", | ||
contents: "string", | ||
image: "string", | ||
start_date: "2022-06-24T08:01:31.122Z", | ||
end_date: "2022-06-24T08:01:31.122Z", | ||
tags: ["깃생살기", "습관 만들기", "운동", "성별무관"], | ||
master: { | ||
email: "[email protected]", | ||
name: "abc", | ||
nick_name: "def", | ||
picture: "string", | ||
id: 0, | ||
complete_rate: 0, | ||
}, | ||
id: 0, | ||
user_cnt: 15, | ||
}, | ||
]; | ||
export const getData = async () => { | ||
if (cache) return cache; | ||
// const res = await fetch(`${baseUrl}/`); | ||
// if (res.ok) { | ||
// const json = await res.json(); | ||
// return json; | ||
// } | ||
throw new Error("요청에 실패함"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,4 @@ export const routes = [ | |
if (path === "/") router.push("/main"); | ||
else router.push(path); | ||
}; | ||
})(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters