diff --git a/lib/model/query/datasets.js b/lib/model/query/datasets.js index 9ac92cdb8..30d95190c 100644 --- a/lib/model/query/datasets.js +++ b/lib/model/query/datasets.js @@ -101,7 +101,7 @@ const createOrMerge = (name, form, fields) => async ({ one, Actees, Datasets, Pr let dsPropertyFields = fields.filter((field) => (field.propertyName)); // Step 2: Check for invalid property names if (dsPropertyFields.filter((field) => !validatePropertyName(field.propertyName)).length > 0) - throw Problem.user.invalidEntityForm({ reason: 'Invalid Dataset property.' }); + throw Problem.user.invalidEntityForm({ reason: 'Invalid entity property name.' }); // Step 3: Build Form Field frames to handle dataset property field insertion dsPropertyFields = dsPropertyFields.map((field) => new Form.Field(field, { propertyName: field.propertyName, schemaId, formDefId })); @@ -110,7 +110,7 @@ const createOrMerge = (name, form, fields) => async ({ one, Actees, Datasets, Pr const result = await one(_createOrMerge(partial, dsPropertyFields, acteeId)) .catch(error => { if (error.constraint === 'ds_property_fields_dspropertyid_formdefid_unique') { - throw Problem.user.invalidEntityForm({ reason: 'Multiple Form Fields cannot be saved to a single Dataset Property.' }); + throw Problem.user.invalidEntityForm({ reason: 'Multiple Form Fields cannot be saved to a single property.' }); } throw error; }); diff --git a/test/integration/api/datasets.js b/test/integration/api/datasets.js index e17e9097c..cc0790579 100644 --- a/test/integration/api/datasets.js +++ b/test/integration/api/datasets.js @@ -2119,7 +2119,7 @@ describe('datasets and entities', () => { .expect(400) .then(({ body }) => { body.code.should.equal(400.25); - body.details.reason.should.equal('Invalid Dataset property.'); + body.details.reason.should.equal('Invalid entity property name.'); })))); it('should return a Problem if the savetos reference invalid properties (extra whitespace)', testService((service) => @@ -2130,7 +2130,7 @@ describe('datasets and entities', () => { .expect(400) .then(({ body }) => { body.code.should.equal(400.25); - body.details.reason.should.equal('Invalid Dataset property.'); + body.details.reason.should.equal('Invalid entity property name.'); })))); it('should return the created form upon success', testService((service) => @@ -2190,7 +2190,7 @@ describe('datasets and entities', () => { .expect(400) .then(({ body }) => { body.code.should.be.eql(400.25); - body.message.should.be.eql('The entity definition within the form is invalid. Multiple Form Fields cannot be saved to a single Dataset Property.'); + body.message.should.be.eql('The entity definition within the form is invalid. Multiple Form Fields cannot be saved to a single property.'); })); })); @@ -2377,7 +2377,7 @@ describe('datasets and entities', () => { .expect(400) .then(({ body }) => { body.code.should.equal(400.25); - body.details.reason.should.equal('Invalid Dataset property.'); + body.details.reason.should.equal('Invalid entity property name.'); })); })); });