-
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.
* feat: axios 설치 * feat: 주행 관련 API 요청 코드 * feat: 주행 API 연결 * fix: 주행 후 리포트에 코멘트 추가 * feat: 홈 페이지 헤더 * feat: 홈 화면 점수 * feat: 주행, 주행기록 API 연결
- Loading branch information
Showing
17 changed files
with
370 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 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,28 @@ | ||
import { axiosInstance } from "./instance"; | ||
|
||
export const drivingStartAPI = async () => { | ||
try { | ||
const response = await axiosInstance.post("/driving/start"); | ||
return response.data; | ||
} catch { | ||
return null; | ||
} | ||
}; | ||
|
||
export const drivingEndAPI = async () => { | ||
try { | ||
const response = await axiosInstance.patch("/driving/end"); | ||
return response.data; | ||
} catch { | ||
return null; | ||
} | ||
}; | ||
|
||
export const drivingEndReportAPI = async (reportId: number) => { | ||
try { | ||
const response = await axiosInstance.get(`/driving/end/${reportId}`); | ||
return response.data; | ||
} catch { | ||
return null; | ||
} | ||
}; |
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,19 @@ | ||
import { axiosInstance } from "./instance"; | ||
|
||
export const historyAPI = async () => { | ||
try { | ||
const response = await axiosInstance.get("/history"); | ||
return response.data; | ||
} catch { | ||
return null; | ||
} | ||
}; | ||
|
||
export const historyDetailAPI = async (reportId: number) => { | ||
try { | ||
const response = await axiosInstance.get(`/history/${reportId}`); | ||
return response.data; | ||
} catch { | ||
return null; | ||
} | ||
}; |
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,8 @@ | ||
import axios from "axios"; | ||
|
||
export const axiosInstance = axios.create({ | ||
baseURL: "http://13.209.80.41:8080", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); |
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 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 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 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 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,12 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Comment = () => { | ||
return <CommentContainer></CommentContainer>; | ||
}; | ||
|
||
const CommentContainer = styled.div` | ||
width: 100%; | ||
height: 100px; | ||
margin-top: 6px; | ||
background-color: white; | ||
`; |
Oops, something went wrong.