mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Fix some updating bugs
This commit is contained in:
parent
1b824782b9
commit
c089824b05
1 changed files with 5 additions and 4 deletions
|
|
@ -293,7 +293,7 @@ const Dashboard: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
setQuizzes(quizzes as QuizType[]);
|
setQuizzes(quizzes as QuizType[]);
|
||||||
|
setSelectedFolder('');
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error deleting folder:', error);
|
console.error('Error deleting folder:', error);
|
||||||
|
|
@ -318,9 +318,11 @@ const Dashboard: React.FC = () => {
|
||||||
try {
|
try {
|
||||||
// folderId: string GET THIS FROM CURRENT FOLDER
|
// folderId: string GET THIS FROM CURRENT FOLDER
|
||||||
await ApiService.duplicateFolder(selectedFolder);
|
await ApiService.duplicateFolder(selectedFolder);
|
||||||
|
// TODO set the selected folder to be the duplicated folder
|
||||||
const userFolders = await ApiService.getUserFolders();
|
const userFolders = await ApiService.getUserFolders();
|
||||||
setFolders(userFolders as FolderType[]);
|
setFolders(userFolders as FolderType[]);
|
||||||
|
const newlyCreatedFolder = userFolders[userFolders.length - 1] as FolderType;
|
||||||
|
setSelectedFolder(newlyCreatedFolder._id);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error duplicating folder:', error);
|
console.error('Error duplicating folder:', error);
|
||||||
}
|
}
|
||||||
|
|
@ -402,7 +404,6 @@ const Dashboard: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='actions'>
|
<div className='actions'>
|
||||||
|
|
||||||
<Tooltip title="Ajouter dossier" placement="top">
|
<Tooltip title="Ajouter dossier" placement="top">
|
||||||
<IconButton
|
<IconButton
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
@ -426,7 +427,7 @@ const Dashboard: React.FC = () => {
|
||||||
> <ContentCopy /> </IconButton>
|
> <ContentCopy /> </IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Tooltip title="Suprimer dossier" placement="top">
|
<Tooltip title="Supprimer dossier" placement="top">
|
||||||
<IconButton
|
<IconButton
|
||||||
aria-label="delete"
|
aria-label="delete"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue