-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/files front #34
base: feature/files_back
Are you sure you want to change the base?
Conversation
putFormData(url, json) { | ||
const body = decamelize(json); | ||
|
||
// humps.decamelizeKeys brakes blob file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
попробуй обновить keysConverter
import humps from 'humps';
import { is } from 'ramda';
const isObject = obj => is(Object, obj);
const isFile = obj => obj instanceof File;
const isArray = obj => obj instanceof Array;
export const camelize = obj => humps.camelizeKeys(obj);
export const decamelize = obj => {
if (isArray(obj)) {
return obj.map(item => decamelize(item));
}
if (isObject(obj) && !isFile(obj)) {
return Object.keys(obj).reduce(
(acc, next) => ({
...acc,
[humps.decamelize(next)]: decamelize(obj[next]),
}),
{},
);
}
return obj;
};
@@ -1,5 +1,6 @@ | |||
import routes from 'routes'; | |||
import FetchHelper from 'utils/fetchHelper'; | |||
import fetchHelper from '../utils/fetchHelper'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
уже же есть импорт фетчхелпера, зачем еще один?
|
||
deleteImage(id) { | ||
const path = routes.removeImageApiV1TaskPath(id); | ||
return FetchHelper.put(path, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пустой объект можно не передавать
No description provided.