forked from RECODE01/Notodo-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df57a59
commit 4c2e2aa
Showing
3 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
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,14 @@ | ||
const baseUrl = | ||
"https://backend.ddudutodo.site/api/v1/challenges"; | ||
|
||
// const cache = {}; | ||
export const getData = async (keywords) => { | ||
|
||
const res = await fetch(`${baseUrl}/`); | ||
if (res.ok) { | ||
const json = await res.json(); | ||
// cache[keywords] = 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 |
---|---|---|
@@ -1 +1,31 @@ | ||
export default function CallengeListPage() {} | ||
import {getData} from "../../../../src/component/challenge/api/getChallengeData" | ||
export default function ChallengeList () { | ||
const target = document.querySelector(".App") | ||
const element = document.createElement("div") | ||
let state = | ||
[ | ||
{ | ||
"name": "string", | ||
"contents": "string", | ||
"image": "string", | ||
"start_date": "2022-06-19T09:19:42.168000+00:00", | ||
"end_date": "2022-06-19T09:19:42.168000+00:00", | ||
"tags": [ | ||
"string" | ||
], | ||
"id": 1 | ||
} | ||
] | ||
state = await getData(0) | ||
|
||
const render = () => { | ||
element.innerHTML = ` | ||
<h1>내 첼린지</h1> | ||
<ul> | ||
</ul | ||
` | ||
} | ||
render() | ||
} |