feat: add CreateDirectory endpoint and S3 directory marker support

Signed-off-by: Noooste <83548733+Noooste@users.noreply.github.com>
This commit is contained in:
Noooste
2026-04-19 17:10:06 +02:00
parent 03bb3e8fb6
commit cb1b14b941
7 changed files with 138 additions and 5 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ export function useBucketObjects(bucketName: string | null, currentPath: string
try {
const dirKey = currentPath ? `${currentPath}${dirName}/` : `${dirName}/`;
await objectsApi.upload(bucketName, dirKey, new File([], '.keep'));
await objectsApi.createDirectory(bucketName, dirKey);
toast.success(`Directory "${dirName}" created successfully`);
await fetchObjects(currentContinuationToken, true);
return true;
+4
View File
@@ -276,6 +276,10 @@ export const objectsApi = {
};
},
createDirectory: async (bucket: string, key: string): Promise<void> => {
await api.post(`/v1/buckets/${bucket}/directories`, { key });
},
upload: async (bucket: string, key: string, file: File, onProgress?: (progress: number) => void): Promise<void> => {
const formData = new FormData();
formData.append('file', file);