pl-fe: more drive works, allow moving folders and files

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-11-27 01:53:06 +01:00
parent d4aa52b7e6
commit 5749341067
11 changed files with 466 additions and 14 deletions

View File

@ -5948,12 +5948,12 @@ class PlApiClient {
return response;
},
moveFolder: async (id: string, targetFolderId: string) => {
moveFolder: async (id: string, targetFolderId?: string) => {
await this.#getIceshrimpAccessToken();
const response = await this.request(`/api/iceshrimp/drive/folder/${id}/move`, {
method: 'POST',
body: { folderId: targetFolderId },
body: { folderId: targetFolderId || null },
});
return v.parse(driveFolderSchema, response.json);
@ -6001,12 +6001,12 @@ class PlApiClient {
return response;
},
moveFile: async (id: string, targetFolderId: string) => {
moveFile: async (id: string, targetFolderId?: string) => {
await this.#getIceshrimpAccessToken();
const response = await this.request(`/api/iceshrimp/drive/${id}/move`, {
method: 'POST',
body: { folderId: targetFolderId },
body: { folderId: targetFolderId || null },
});
return v.parse(driveFileSchema, response.json);