1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

tried to make upload sagas

This commit is contained in:
muerwre 2019-08-07 15:09:28 +07:00
parent caf85c104f
commit 3872ff5903
9 changed files with 180 additions and 80 deletions

View file

@ -1,7 +1,25 @@
import {UPLOAD_ACTIONS} from "~/redux/uploads/constants";
import { UPLOAD_ACTIONS } from "~/redux/uploads/constants";
import { IFileWithUUID, UUID } from "../types";
import { IUploadStatus } from "./reducer";
export const uploadUploadFiles = (files: File[], subject: string) => ({
export const uploadUploadFiles = (files: IFileWithUUID[]) => ({
files,
subject,
type: UPLOAD_ACTIONS.UPLOAD_FILES,
});
export const uploadAddStatus = (temp_id: UUID, status?: Partial<IUploadStatus>) => ({
temp_id,
status,
type: UPLOAD_ACTIONS.ADD_STATUS,
});
export const uploadSetStatus = (temp_id: UUID, status?: Partial<IUploadStatus>) => ({
temp_id,
status,
type: UPLOAD_ACTIONS.SET_STATUS,
});
export const uploadDropStatus = (temp_id: UUID) => ({
temp_id,
type: UPLOAD_ACTIONS.DROP_STATUS,
});