@woocommerce/data
Version:
WooCommerce Admin data store and utilities
42 lines (41 loc) • 1.31 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProductFormError = exports.getProductFormSuccess = exports.getFieldsError = exports.getFieldsSuccess = void 0;
/**
* Internal dependencies
*/
const action_types_1 = __importDefault(require("./action-types"));
function getFieldsSuccess(fields) {
return {
type: action_types_1.default.GET_FIELDS_SUCCESS,
fields,
};
}
exports.getFieldsSuccess = getFieldsSuccess;
function getFieldsError(error) {
return {
type: action_types_1.default.GET_FIELDS_ERROR,
error,
};
}
exports.getFieldsError = getFieldsError;
function getProductFormSuccess(productForm) {
return {
type: action_types_1.default.GET_PRODUCT_FORM_SUCCESS,
fields: productForm.fields,
sections: productForm.sections,
subsections: productForm.subsections,
tabs: productForm.tabs,
};
}
exports.getProductFormSuccess = getProductFormSuccess;
function getProductFormError(error) {
return {
type: action_types_1.default.GET_PRODUCT_FORM_ERROR,
error,
};
}
exports.getProductFormError = getProductFormError;