updated
This commit is contained in:
parent
85b30b4765
commit
3b39a2a2e5
|
@ -91,8 +91,8 @@ async def delete_organ(
|
||||||
"""
|
"""
|
||||||
organ = session.get(Organ, id)
|
organ = session.get(Organ, id)
|
||||||
if not organ:
|
if not organ:
|
||||||
raise HTTPException(status_code=404, detail="aboutUs not found")
|
raise HTTPException(status_code=404, detail="Organ not found")
|
||||||
await del_picture(organ.image)
|
await del_picture(organ.image)
|
||||||
session.delete(organ)
|
session.delete(organ)
|
||||||
session.commit()
|
session.commit()
|
||||||
return Message(message="aboutUs deleted successfully")
|
return Message(message="Organ deleted successfully")
|
||||||
|
|
|
@ -86,7 +86,7 @@ const Delete = ({ type, id, isOpen, onClose }: DeleteProps) => {
|
||||||
} else if (type === "AboutUs") {
|
} else if (type === "AboutUs") {
|
||||||
key = "aboutUs"
|
key = "aboutUs"
|
||||||
} else if(type === "Organ"){
|
} else if(type === "Organ"){
|
||||||
key = "organs"
|
key = "organ"
|
||||||
} else if (type === "Course") {
|
} else if (type === "Course") {
|
||||||
key = "courses"
|
key = "courses"
|
||||||
} else if (type === "Image") {
|
} else if (type === "Image") {
|
||||||
|
|
|
@ -117,7 +117,7 @@ function OrganTable() {
|
||||||
{organ.index}
|
{organ.index}
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<ActionsMenu type={"AboutUs"} value={organ} />
|
<ActionsMenu type={"Organ"} value={organ} />
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
))}
|
))}
|
||||||
|
@ -152,7 +152,7 @@ function Organ() {
|
||||||
Electric organ Management
|
Electric organ Management
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Navbar type={"AboutUs"} addModalAs={AddOrgan} />
|
<Navbar type={"Organ"} addModalAs={AddOrgan} />
|
||||||
<OrganTable />
|
<OrganTable />
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue