-
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 #154 from PLADI-ALM/feat/PDW-19-equipment
[PDW-21/feat] 비품 수정 및 삭제
- Loading branch information
Showing
10 changed files
with
118 additions
and
38 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 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,40 @@ | ||
import React from 'react'; | ||
import {EquipmentMoreModalView, MenuText, NormalDiv, RedDiv} from "./MoreModal"; | ||
import {EquipmentsAxios} from "api/AxiosApi"; | ||
import {getToken} from "utils/IsLoginUtil"; | ||
import {basicError} from "utils/ErrorHandlerUtil"; | ||
|
||
export function EquipmentMoreModal(props) { | ||
|
||
const editEquipment = () => { | ||
window.location.href = `/equipments/${props.id}/edit` | ||
}; | ||
|
||
const deleteEquipment = () => { | ||
EquipmentsAxios.delete(`/${props.id}`, { | ||
headers: { | ||
Authorization: getToken() | ||
} | ||
}) | ||
.then((response) => { | ||
alert("삭제되었습니다.") | ||
window.location.reload(); | ||
}) | ||
.catch((error) => { | ||
basicError(error) | ||
}) | ||
}; | ||
|
||
return ( | ||
<> | ||
<EquipmentMoreModalView onClick={(e) => e.stopPropagation()}> | ||
<NormalDiv> | ||
<MenuText onClick={editEquipment}>수정</MenuText> | ||
</NormalDiv> | ||
<RedDiv> | ||
<MenuText onClick={deleteEquipment}>삭제</MenuText> | ||
</RedDiv> | ||
</EquipmentMoreModalView> | ||
</> | ||
); | ||
} |
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
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