Skip to content

Commit 5364bc2

Browse files
committed
Add uuid property to DriveItemInfoModal and update related services
1 parent 28fcb24 commit 5364bc2

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/modals/DriveItemInfoModal/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function DriveItemInfoModal(): JSX.Element {
101101
{
102102
dbItemId: dbItem?.id || item.id,
103103
id: isFolder ? item.id.toString() : (item.fileId as string),
104+
uuid: item?.uuid,
104105
type: isFolder ? 'folder' : 'file',
105106
},
106107
],

src/network/upload.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export async function uploadFile(
5757

5858
return await uploadPromise;
5959
} catch (err) {
60-
console.warn(`Upload attempt ${attempt} of ${MAX_TRIES} failed:`, err);
6160
logger.error(`Upload attempt ${attempt} of ${MAX_TRIES} failed:`, err);
6261

6362
const lastTryFailed = attempt === MAX_TRIES;

src/services/drive/trash/driveTrash.service.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ class DriveTrashService {
8484
return this.sdk.trash.clearTrash();
8585
}
8686

87-
public async moveToTrash(items: { id: number | string; type: 'folder' | 'file' }[]) {
87+
public async moveToTrash(items: { id: number | string; type: 'folder' | 'file'; uuid?: string }[]) {
8888
const itemsToMove = items.map((item) => {
89+
if (item.uuid !== undefined) {
90+
return {
91+
id: null,
92+
uuid: item.uuid,
93+
type: item.type,
94+
};
95+
}
96+
8997
return {
9098
id: item.id,
9199
type: item.type,

src/useCases/drive/trash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const clearTrash = async (): Promise<UseCaseResult<null>> => {
181181
* Moves items to trash
182182
*/
183183
export const moveItemsToTrash = async (
184-
items: { id: string; type: 'file' | 'folder'; dbItemId: number }[],
184+
items: { id: string; type: 'file' | 'folder'; dbItemId: number; uuid?: string }[],
185185
onUndo: () => void,
186186
): Promise<UseCaseResult<null>> => {
187187
try {

0 commit comments

Comments
 (0)