Skip to content

Commit

Permalink
Courses won't be deleted if they have no destination (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWu098 authored Jul 24, 2023
1 parent 6cd55c7 commit a19258c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions site/src/pages/RoadmapPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ const RoadmapPage: FC = () => {

const onDragEnd = useCallback((result: DropResult) => {
if (result.reason === 'DROP') {
// no destination or dragging to search bar
if (!result.destination || result.destination.droppableId === 'search') {
// no destination
if(!result.destination) { return }

// dragging to search bar
if (result.destination.droppableId === 'search') {
// removing from quarter
if (result.source.droppableId != 'search') {
let [yearIndex, quarterIndex] = result.source.droppableId.split('-');
Expand Down

0 comments on commit a19258c

Please sign in to comment.