Skip to content

Commit

Permalink
Small changes in response to PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Nov 14, 2023
1 parent aeec6df commit f5abe29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/model/query/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const _processSubmissionEvent = (event, parentEvent) => async ({ Datasets, Entit
const dataset = (await Datasets.get(form.get().projectId, entityData.system.dataset, true))
.orThrow(Problem.user.datasetNotFound({ datasetName: entityData.system.dataset }));

// Or update entity
// Try update before create (if both are specified)
if (entityData.system.update === '1' || entityData.system.update === 'true')
try {
await Entities._updateEntity(dataset, entityData, submissionId, submissionDef, submissionDefId, event);
Expand Down
2 changes: 2 additions & 0 deletions test/integration/api/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,8 @@ describe('Entities API', () => {
.expect(200)
.then(({ body: logs }) => {
logs[0].action.should.be.eql('entity.error');
logs[0].details.problem.problemCode.should.be.eql(400.2);
logs[0].details.errorMessage.should.be.eql('Required parameter label missing.')

Check failure on line 2207 in test/integration/api/entities.js

View workflow job for this annotation

GitHub Actions / standard-tests

Missing semicolon
logs[1].action.should.be.eql('submission.create');
});
}));
Expand Down

0 comments on commit f5abe29

Please sign in to comment.