feat: Add loading toasts

This commit is contained in:
swve 2024-08-13 18:13:58 +02:00
parent 0f2b8689c4
commit c68fa66ff8
7 changed files with 34 additions and 4 deletions

View file

@ -234,7 +234,9 @@ const DeleteUpdateButton = ({ update }: any) => {
const handleDelete = async () => {
const res = await deleteCourseUpdate(course.courseStructure.course_uuid, update.courseupdate_uuid, session.data?.tokens?.access_token)
const toast_loading = toast.loading('Deleting update...')
if (res.status === 200) {
toast.dismiss(toast_loading)
toast.success('Update deleted successfully')
mutate(`${getAPIUrl()}courses/${course?.courseStructure.course_uuid}/updates`)
}