Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
3513 Представления

Hello,

I tried to inherit from documents.controllerMixin because I need to rewrite the _makeFileUploadFormDataKeys function, because I need to add the some values from context, but it doesn't work for me. Does anyone know how to overwrite?
This is what I did:

const documentsControllerMixin = require("documents.controllerMixin");
const DocumentSaleMixin = Object.assign({}, documentsControllerMixin, {
_makeFileUploadFormDataKeys({ recordId }) {
const context = this.model.get(this.handle, { raw: true }).getContext();
return {
document_id: recordId,
folder_id: this.searchModel.get('selectedFolderId'),
tag_ids: this.searchModel.get('selectedTagIds'),
owner_id: context && context.default_owner_id,
partner_id: context && context.default_partner_id,
​active_model: context && context.​active_model,
active_id: context && context.active_id,
};
},
});
return DocumentSaleMixin;
Thank you


Аватар
Отменить
Лучший ответ

Hi

Try the following code

const documentsControllerMixin = require("documents.controllerMixin");
documentsControllerMixin._makeFileUploadFormDataKeys = ({ recordId }) => {
    const context = this.model.get(this.handle, { raw: true }).getContext();
    return {
        document_id: recordId,
        folder_id: this.searchModel.get('selectedFolderId'),
        tag_ids: this.searchModel.get('selectedTagIds'),
        owner_id: context && context.default_owner_id,
        partner_id: context && context.default_partner_id,
        active_model: context && context.active_model,
        active_id: context && context.active_id,
    };
},

Hope it helps

Аватар
Отменить
Лучший ответ

I tried this method inherit _makeFileUploadFormDataKeys  and some code add  but this not working documents.controllerMixin how to inherit this file function inherit.

  


Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
мая 23
3143
0
янв. 21
8359
1
апр. 23
1807
0
окт. 22
571
0
апр. 22
2397