nuxt-upload-kit 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -189,7 +189,9 @@ export declare const useUploadKit: <TUploadResult = any>(_options?: UploadOption
|
|
|
189
189
|
addFile: (file: File) => Promise<UploadFile>;
|
|
190
190
|
onGetRemoteFile: (fn: GetRemoteFileFn) => void;
|
|
191
191
|
onUpload: (fn: UploadFn<TUploadResult>) => void;
|
|
192
|
-
removeFile: (fileId: string
|
|
192
|
+
removeFile: (fileId: string, removeOptions?: {
|
|
193
|
+
deleteFromStorage?: boolean;
|
|
194
|
+
}) => Promise<void>;
|
|
193
195
|
removeFiles: (fileIds: string[]) => ({
|
|
194
196
|
source: "local";
|
|
195
197
|
data: {
|
|
@@ -257,10 +257,11 @@ This is deprecated. Use the 'storage' option instead:
|
|
|
257
257
|
const addedFiles = results.filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
258
258
|
return addedFiles;
|
|
259
259
|
};
|
|
260
|
-
const removeFile = async (fileId) => {
|
|
260
|
+
const removeFile = async (fileId, removeOptions) => {
|
|
261
|
+
const { deleteFromStorage = true } = removeOptions ?? {};
|
|
261
262
|
const file = files.value.find((f) => f.id === fileId);
|
|
262
263
|
if (!file) return;
|
|
263
|
-
if (file.remoteUrl) {
|
|
264
|
+
if (deleteFromStorage && file.remoteUrl) {
|
|
264
265
|
const storagePlugin = getStoragePlugin();
|
|
265
266
|
if (storagePlugin?.hooks.remove) {
|
|
266
267
|
try {
|
package/package.json
CHANGED