Skip to content

Commit

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

const handleMoveUp = (i: number) => {
if (i > 0 && i < data.length) {
let updatedData = [...data];
let updatedData = [...data.filter((d: any) => d.trial == trial)];
console.log(updatedData);
let temp = updatedData[i];
updatedData.splice(i, 1);
updatedData.splice(i - 1, 0, temp);
recalculate(updatedData.map((d: any, i: number) => ({ ...d, sort: i })));
recalculate([
...updatedData.map((d: any, i: number) => ({ ...d, sort: i })),
...data.filter((d: any) => d.trial != trial),
]);
}
};
const handleMoveDown = (i: number) => {
if (i >= 0 && i < data.length) {
let updatedData = [...data];
let updatedData = [...data.filter((d: any) => d.trial == trial)];
let temp = updatedData[i];
updatedData.splice(i, 1);
updatedData.splice(i + 1, 0, temp);
recalculate(updatedData.map((d: any, i: number) => ({ ...d, sort: i })));
recalculate([
...updatedData.map((d: any, i: number) => ({ ...d, sort: i })),
...data.filter((d: any) => d.trial != trial),
]);
}
};

Expand Down

0 comments on commit e7be435

Please sign in to comment.