Skip to content
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

Merged
merged 17 commits into from
Apr 30, 2024
Merged

Read,list,delete query template #149

merged 17 commits into from
Apr 30, 2024

Conversation

yashashkumar
Copy link

…ion and route

Copy link
Collaborator

@HarishGangula HarishGangula left a 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

@@ -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);
Copy link
Collaborator

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

@yashashkumar yashashkumar changed the title Read query template Read,list,delete query template Apr 29, 2024
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) {
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@HarishGangula HarishGangula merged commit e707bb0 into #54 Apr 30, 2024
1 check passed
@HarishGangula HarishGangula deleted the read-template branch April 30, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants