-
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.
Merge pull request #6 from FastCampus-Mini5/duty
docs: api 분류
- Loading branch information
Showing
11 changed files
with
156 additions
and
172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const API_URL = import.meta.env.VITE_BASE_URL; |
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,89 @@ | ||
import axios from "axios" | ||
import { API_URL } from './Base'; | ||
|
||
interface User { | ||
username: string, | ||
email: string, | ||
hireDate: string | ||
reaminVacation: number | ||
} | ||
|
||
export const userListApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/user/list`) | ||
if(data) { | ||
return data | ||
} | ||
else { | ||
throw new Error('기록 작성에 실패하셨습니다.') | ||
} | ||
} catch (error) { | ||
throw error | ||
} | ||
} | ||
|
||
export const userApproveApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/signup/list`) | ||
if(data) { | ||
return data | ||
} | ||
else { | ||
throw new Error('기록 작성에 실패하셨습니다.') | ||
} | ||
} catch(error) { | ||
throw error | ||
} | ||
} | ||
|
||
export const vacationApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/vacation/approve/list`) | ||
if(data) { | ||
return data | ||
} else { | ||
throw new Error('기록 작성에 실패하셨습니다') | ||
} | ||
} catch(error) { | ||
throw(error) | ||
} | ||
} | ||
|
||
export const vacationPendingApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/vacation/pending`) | ||
if(data) { | ||
return data | ||
} else { | ||
throw new Error('기록 작성에 실패하셨습니다') | ||
} | ||
} catch(error) { | ||
throw(error) | ||
} | ||
} | ||
|
||
export const DutyListApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/duty/approve/list`) | ||
if(data) { | ||
return data | ||
} else { | ||
throw new Error('기록 작성에 실패하셨습니다.') | ||
} | ||
} catch(error) { | ||
throw(error) | ||
} | ||
} | ||
|
||
export const DutyPeindingListsApi = async() => { | ||
try { | ||
const data = await axios.get(`${API_URL}/api/admin/duty/pending`) | ||
if(data) { | ||
return data | ||
} else { | ||
throw new Error('기록 작성에 실패하셨습니다.') | ||
} | ||
}catch (error) { | ||
throw(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
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
Oops, something went wrong.