feat: add a common upload endpoint (#7806)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
|
||||
import types from '../mutation-types';
|
||||
import { uploadFile } from 'dashboard/helper/uploadHelper';
|
||||
import AutomationAPI from '../../api/automation';
|
||||
|
||||
export const state = {
|
||||
@@ -77,12 +78,8 @@ export const actions = {
|
||||
}
|
||||
},
|
||||
uploadAttachment: async (_, file) => {
|
||||
try {
|
||||
const { data } = await AutomationAPI.attachment(file);
|
||||
return data.blob_id;
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
const { blobId } = await uploadFile(file);
|
||||
return blobId;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user