55 lines
796 B
JavaScript
Raw Normal View History

/**
*
* EditPage actions
*
*/
import {
2018-02-21 15:09:33 +01:00
CHANGE_DATA,
GET_DATA,
GET_DATA_SUCCEEDED,
INIT_MODEL_PROPS,
RESET_PROPS,
} from './constants';
2018-02-21 15:09:33 +01:00
export function changeData({ target }) {
return {
type: CHANGE_DATA,
keys: target.name.split('.'),
value: target.value,
};
}
export function getData(id, source, mainField) {
return {
type: GET_DATA,
id,
source,
mainField,
};
}
export function getDataSucceeded(id, data, pluginHeaderTitle) {
return {
type: GET_DATA_SUCCEEDED,
id,
data,
pluginHeaderTitle,
};
}
2018-02-21 17:14:35 +01:00
export function initModelProps(modelName, isCreating, source) {
return {
type: INIT_MODEL_PROPS,
modelName,
isCreating,
2018-02-21 15:09:33 +01:00
source,
};
}
export function resetProps() {
return {
type: RESET_PROPS,
};
}