PMCORE-3365:Preview is not working in Custom Case List

CR
This commit is contained in:
Fabio Guachalla
2021-09-23 12:10:40 -04:00
parent 5146d8b7e4
commit 054b78e599

View File

@@ -124,22 +124,23 @@ export default {
getCasesForPreview(data) { getCasesForPreview(data) {
let that = this, let that = this,
dt, dt,
paged,
limit = data.limit, limit = data.limit,
start = data.page === 1 ? 0 : limit * (data.page - 1), start = data.page === 1 ? 0 : limit * (data.page - 1),
filters = {}; params = {};
paged = start + "," + limit; params = {
filters = { filters: {
paged: paged, limit: limit,
offset: start,
},
} }
if (this.customCaseId !== '') { if (this.customCaseId !== '') {
filters['id'] = this.customCaseId; params['id'] = this.customCaseId;
} }
return new Promise((resolutionFunc, rejectionFunc) => { return new Promise((resolutionFunc, rejectionFunc) => {
switch (that.type) { switch (that.type) {
case 'inbox': case 'inbox':
api.cases api.custom
.inbox(filters) .inbox(params)
.then((response) => { .then((response) => {
dt = that.formatDataResponse(response.data.data); dt = that.formatDataResponse(response.data.data);
resolutionFunc({ resolutionFunc({
@@ -152,8 +153,8 @@ export default {
}); });
break; break;
case 'draft': case 'draft':
api.cases api.custom
.draft(filters) .draft(params)
.then((response) => { .then((response) => {
dt = that.formatDataResponse(response.data.data); dt = that.formatDataResponse(response.data.data);
resolutionFunc({ resolutionFunc({
@@ -166,8 +167,8 @@ export default {
}); });
break; break;
case 'paused': case 'paused':
api.cases api.custom
.paused(filters) .paused(params)
.then((response) => { .then((response) => {
dt = that.formatDataResponse(response.data.data); dt = that.formatDataResponse(response.data.data);
resolutionFunc({ resolutionFunc({
@@ -180,8 +181,8 @@ export default {
}); });
break; break;
case 'unassigned': case 'unassigned':
api.cases api.custom
.unassigned(filters) .unassigned(params)
.then((response) => { .then((response) => {
dt = that.formatDataResponse(response.data.data); dt = that.formatDataResponse(response.data.data);
resolutionFunc({ resolutionFunc({