Skip to content
Snippets Groups Projects
Commit 5dc70e51 authored by Ramesh Kumar's avatar Ramesh Kumar
Browse files

TMSS-473: Added limit to fetch all records from SU drafts and blueprints.

parent 32794144
No related branches found
No related tags found
1 merge request!288Resolve TMSS-473
......@@ -8,22 +8,26 @@ axios.defaults.headers.common['Authorization'] = 'Basic dGVzdDp0ZXN0';
const ScheduleService = {
getSchedulingUnitDraft: async function (){
let res = [];
await axios.get('/api/scheduling_unit_draft/?ordering=id')
.then(response => {
res= response;
}).catch(function(error) {
try {
res = await axios.get('/api/scheduling_unit_draft/?limit=1');
if (res.data.count > res.data.results.length) {
res = await axios.get(`/api/scheduling_unit_draft/?ordering=id&limit=${res.data.count}&offset=0`);
}
} catch(error) {
console.error('[schedule.services.getSchedulingUnitDraft]',error);
});
}
return res;
},
getSchedulingUnitBlueprint: async function (){
let res = [];
await axios.get('/api/scheduling_unit_blueprint/?ordering=id')
.then(response => {
res= response;
}).catch(function(error) {
try {
res = await axios.get('/api/scheduling_unit_blueprint/?limit=1');
if (res.data.count > res.data.results.length) {
res = await axios.get(`/api/scheduling_unit_blueprint/?ordering=id&limit=${res.data.count}&offset=0`);
}
} catch(error) {
console.error('[schedule.services.getSchedulingUnitBlueprint]',error);
});
}
return res;
},
getSchedulingUnitBlueprintById: async function (id){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment