Skip to content

Commit

Permalink
self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrina-p committed Jul 18, 2024
1 parent 778dc1d commit defb1de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/modify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ function shortToFullPath(path) {
}

function standardizeAttrs(attrs) {
const { errorMessage, presentation, properties, ...rest } = attrs;
const { errorMessage, properties, ...rest } = attrs;

return {
...rest,
...(errorMessage ? { 'x-jsf-errorMessage': errorMessage } : {}),
...(presentation ? { 'x-jsf-presentation': presentation } : {}),
};
}

Expand Down Expand Up @@ -76,8 +75,6 @@ function setFields(schema, fieldsConfig) {
fieldsToAdd.forEach(([shortPath, fieldAttrs]) => {
const fieldPath = shortToFullPath(shortPath);

console.log('fieldAttrs', fieldAttrs);

if (fieldAttrs.properties) {
// Recursive to nested fields...
setFields(get(schema.properties, fieldPath), fieldAttrs.properties);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/modify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe('modify() - basic mutations', () => {
expect(result).toMatchObject(schemaPet);
});

it('customize error message (sugar syntax)', () => {
it('error message', () => {
const result = modify(schemaPet, {
fields: {
pet_age: (fieldAttrs) => {
Expand Down

0 comments on commit defb1de

Please sign in to comment.