Skip to content

Commit

Permalink
Merge pull request #344 from micronutrientsupport/andan_bm_cache
Browse files Browse the repository at this point in the history
feat: cache biomarker data responses for 24hrs
  • Loading branch information
bgsandan authored Jan 10, 2024
2 parents 299fefc + 0f57184 commit 8c1fe0b
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/controllers/biomarker-controller.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,7 @@ export class BiomarkerControllerController {
@inject(RestBindings.Http.RESPONSE) public response: Response,
) {}

@CacheHeader(3600)
@get('/biomarker-cached', {
responses: new StandardOpenApiResponses(
'Array of BiomarkerSummary model instances',
)
.setDataType('array')
.setObjectSchema(getModelSchemaRef(BiomarkerSummary))
.toObject(),
})
async findCached(
@param.query.string('surveyId') surveyId: number,
@param.query.string('groupId') groupId: string,
@param.query.string('biomarker') biomarker: string,
@param.query.string('aggregationField') aggregationField: string,
): Promise<{}> {
return this.find(surveyId, groupId, biomarker, aggregationField);

//rthis.find(surveyId, groupId, biomarker, aggregationField
}

@CacheHeader(86400)
@get('/biomarker', {
responses: new StandardOpenApiResponses(
'Array of BiomarkerSummary model instances',
Expand Down

0 comments on commit 8c1fe0b

Please sign in to comment.