feat: many to many - child listing

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
This commit is contained in:
Pranav C
2021-06-23 20:10:29 +05:30
parent edf6cb2f36
commit 7b0a39bccc
9 changed files with 413 additions and 54 deletions

View File

@@ -48,7 +48,19 @@ export default class RestApi {
async paginatedList(params) {
// const list = await this.list(params);
// const count = (await this.count({where: params.where || ''})).count;
const [list, {count}] = await Promise.all([this.list(params), this.count({where: params.where || ''})]);
const [list, {count}] = await Promise.all([this.list(params), this.count({
where: params.where || '',
conditionGraph: params.conditionGraph
})]);
return {list, count};
}
async paginatedM2mNotChildrenList(params, assoc, pid) {
///api/v1/Film/m2mNotChildren/film_actor/44
// const list = await this.list(params);
// const count = (await this.count({where: params.where || ''})).count;
const {list, info: {count}} = (await this.get(`/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}/m2mNotChildren/${assoc}/${pid}`, params)).data
debugger
return {list, count};
}