forked from polka_billy/porridger
Fixed ann removal
This commit is contained in:
@ -11,7 +11,8 @@ import { useId } from '../hooks'
|
||||
|
||||
type AnnouncementDetailsProps = {
|
||||
close: () => void,
|
||||
announcement: Announcement
|
||||
refresh: () => void,
|
||||
announcement: Announcement,
|
||||
}
|
||||
|
||||
const styles = {
|
||||
@ -26,11 +27,17 @@ const styles = {
|
||||
} as CSSProperties,
|
||||
}
|
||||
|
||||
function AnnouncementDetails({ close, announcement: {
|
||||
function AnnouncementDetails({ close, refresh, announcement: {
|
||||
id, name, category, bestBy, description, lat, lng, address, metro, bookedBy, userId
|
||||
} }: AnnouncementDetailsProps) {
|
||||
const { handleBook, bookButton } = useBook()
|
||||
const { handleRemove, removeButton } = useRemoveAnnouncement(close)
|
||||
|
||||
const removeRefresh = () => {
|
||||
close()
|
||||
refresh()
|
||||
}
|
||||
|
||||
const { handleRemove, removeButton } = useRemoveAnnouncement(removeRefresh)
|
||||
|
||||
const myId = useId()
|
||||
|
||||
|
Reference in New Issue
Block a user