mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
file uploading template
This commit is contained in:
parent
cfe4731ded
commit
8dc43c77b7
7 changed files with 57 additions and 10 deletions
7
src/redux/uploads/actions.ts
Normal file
7
src/redux/uploads/actions.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import {UPLOAD_ACTIONS} from "~/redux/uploads/constants";
|
||||
|
||||
export const uploadUploadFiles = (files: File[], subject: string) => ({
|
||||
files,
|
||||
subject,
|
||||
type: UPLOAD_ACTIONS.UPLOAD_FILES,
|
||||
});
|
|
@ -1,5 +1,11 @@
|
|||
import { IFile } from "~/redux/types";
|
||||
|
||||
const prefix = 'UPLOAD.';
|
||||
|
||||
export const UPLOAD_ACTIONS = {
|
||||
UPLOAD_FILES: `${prefix}UPLOAD_FILES`,
|
||||
};
|
||||
|
||||
export const EMPTY_FILE: IFile = {
|
||||
id: null,
|
||||
user_id: null,
|
||||
|
@ -11,4 +17,4 @@ export const EMPTY_FILE: IFile = {
|
|||
size: 2400000,
|
||||
type: 'image',
|
||||
mime: 'image/jpeg',
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
export default function* () {
|
||||
import {takeEvery} from "redux-saga/effects";
|
||||
import {UPLOAD_ACTIONS} from "~/redux/uploads/constants";
|
||||
|
||||
}
|
||||
export default function* () {
|
||||
yield takeEvery(UPLOAD_ACTIONS.UPLOAD_FILES, console.log);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue