🍄 Separate trash for the personal and shared drive (#189)

This commit is contained in:
Montassar Ghanmy
2023-10-06 17:05:07 +01:00
committed by GitHub
parent f0dcf34bbe
commit edfd765d57
34 changed files with 440 additions and 185 deletions
@@ -96,6 +96,18 @@ export const useDriveActions = () => {
[refresh],
);
const restore = useCallback(
async (id: string, parentId: string) => {
try {
await DriveApiClient.restore(companyId, id);
await refresh(parentId || '');
} catch (e) {
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_restore_file'));
}
},
[refresh],
);
const update = useCallback(
async (update: Partial<DriveItem>, id: string, parentId: string) => {
try {
@@ -127,5 +139,5 @@ export const useDriveActions = () => {
[refresh],
);
return { create, refresh, download, downloadZip, remove, update, updateLevel };
return { create, refresh, download, downloadZip, remove, restore, update, updateLevel };
};