-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read,list,delete query template #149
Conversation
…hich returns all the record and added route
…and added delete and list template service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List API changes need to be done
api-service/src/routes/Router.ts
Outdated
@@ -22,7 +25,9 @@ router.get("/v1/datasets/read/:dataset_id", setDataToRequestObject("api.datasets | |||
router.post("/v1/datasets/list", setDataToRequestObject("api.datasets.list"), onRequest({ entity: Entity.Management }), DatasetList) | |||
router.get('/v1/data/exhaust/:datasetId', setDataToRequestObject("api.data.exhaust"), onRequest({ entity: Entity.Management }), dataExhaust); | |||
router.post('/v1/template/create', setDataToRequestObject("query.template.create"), createQueryTemplate); | |||
|
|||
router.get('/v1/template/read/:templateId', setDataToRequestObject("query.template.read"), readQueryTemplate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add api
as prefix for all the api ids
…ded validation schema for list template api
… limit, offset, and filtery by type)
… limit, offset, and filtery by type)
api-service/src/controllers/ReadQueryTemplate/ReadTemplateController.ts
Outdated
Show resolved
Hide resolved
api-service/src/controllers/ListQueryTemplates/ListTemplateValidationSchema.json
Show resolved
Hide resolved
const offset: any = _.get(req, "offset"); | ||
const { filters = {}, sortBy = [] } = req || {}; | ||
const templates = await QueryTemplate.findAll({ limit: limit || 100, offset: offset || 0, ...(filters && { where: filters }) }) | ||
if (sortBy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort should be part of query not script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…ion and route