Skip to content

Commit

Permalink
fix(application): 🚑 Application delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Jan 14, 2024
1 parent e86e424 commit 9b14706
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/teams/[team]/manage/apply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const Apply: NextPage = ({ data: tempData, team }: any) => {

const handleDeleteQuestion = (id: string) => {
setData(data?.filter((d: any) => d.id !== id));
setDeletedData([...deletedData, data.find((d: any) => d.id === id)]);
const d = data.find((d: any) => d.id === id);
setDeletedData([...deletedData, { ...d, sort: -1 }]);
};

const handleUpdateEditingQuestion = (question: any, additional?: boolean) => {
Expand Down Expand Up @@ -154,7 +155,8 @@ const Apply: NextPage = ({ data: tempData, team }: any) => {
color: 'green',
icon: <IconCheck />,
});
setData(res);
setData(res?.filter((d: any) => d.sort >= 0));
setDeletedData(res?.filter((d: any) => d.sort < 0));
setSaveLoading(false);
}
});
Expand Down

0 comments on commit 9b14706

Please sign in to comment.