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

refactored to match backend

This commit is contained in:
Fedor Katurov 2020-07-12 15:39:09 +07:00
parent 33a55c852d
commit 6b6c7f5dd2
4 changed files with 8 additions and 10 deletions

View file

@ -17,7 +17,7 @@ export const API = {
NODE: {
SAVE: '/node/',
GET: '/node/',
GET_DIFF: '/nodes/diff',
GET_DIFF: '/flow/diff',
GET_NODE: (id: number | string) => `/node/${id}`,
COMMENT: (id: INode['id']) => `/node/${id}/comment`,
@ -34,9 +34,9 @@ export const API = {
NODES: '/search/nodes',
},
EMBED: {
YOUTUBE: '/embed/youtube',
YOUTUBE: '/meta/youtube',
},
BORIS: {
GET_BACKEND_STATS: '/stats',
GET_BACKEND_STATS: '/stats/',
},
};

View file

@ -6,6 +6,7 @@ export const ERRORS = {
FILES_REQUIRED: 'Files_Required',
TEXT_REQUIRED: 'Text_Required',
UNKNOWN_NODE_TYPE: 'Unknown_Node_Type',
UNKNOWN_FILE_TYPE: 'Unknown_File_Type',
URL_INVALID: 'Url_Invalid',
FILES_AUDIO_REQUIRED: 'Files_Audio_Required',
NOT_ENOUGH_RIGHTS: 'Not_Enough_Rights',
@ -18,6 +19,7 @@ export const ERRORS = {
DOESNT_MATCH: 'Doesnt_Match',
REQUIRED: 'Required',
COMMENT_NOT_FOUND: 'Comment_Not_Found',
FILE_IS_TOO_BIG: 'File_Is_Too_Big',
};
export const ERROR_LITERAL = {
@ -40,4 +42,6 @@ export const ERROR_LITERAL = {
[ERRORS.DOESNT_MATCH]: 'Пароли не совпадают',
[ERRORS.REQUIRED]: 'Обязательное поле',
[ERRORS.COMMENT_NOT_FOUND]: 'Комментарий не найден',
[ERRORS.UNKNOWN_FILE_TYPE]: 'Запрещенный тип файла',
[ERRORS.FILE_IS_TOO_BIG]: 'Файл слишком большой',
};

View file

@ -19,13 +19,9 @@ export const URLS = {
export const PRESETS = {
'1600': '1600',
'900': '900',
'600': '600',
'300': '300',
'100': '100',
placeholder: 'placeholder',
cover: 'cover',
hero: 'hero',
small_hero: 'small_hero',
avatar: 'avatar',
};

View file

@ -66,14 +66,12 @@ function* uploadWorker({ file, temp_id, target, type }: IFileWithUUID) {
yield fork(onUploadProgress, chan);
const result = yield call(promise, {
return yield call(promise, {
temp_id,
file,
target,
type
});
return result;
}
function* uploadFile({