Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBabukov committed Apr 21, 2022
1 parent e0303e6 commit 743aa0c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/api.v2/model/Experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ class Experiment extends BasicModel {
}

async getProcessingConfig(experimentId) {
const result = await this.find({ id: experimentId });
const result = await this.findOne({ id: experimentId });
if (_.isEmpty(result)) {
throw new NotFoundError('Experiment not found');
}

return result[0].processingConfig;
return result.processingConfig;
}

async updateProcessingConfig(experimentId, body) {
Expand Down
28 changes: 15 additions & 13 deletions src/specs/api.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,25 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ProcessingConfig'
'404':
description: Not found error.
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
$ref: '#/components/schemas/HTTPError'
'401':
description: The request lacks authentication credentials.
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
'404':
description: Not found error.
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'

put:
summary: Update processing configuration for an experiment
description: Update processing configuration for an experiment
Expand All @@ -103,12 +104,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPSuccess'
'404':
description: Not found error.
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
'400':
description: Bad Request
content:
Expand All @@ -121,6 +116,13 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
'404':
description: Not found error.
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'

'/experiments':
get:
summary: Get all experiments
Expand Down

0 comments on commit 743aa0c

Please sign in to comment.