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

TMSS-2196: All subtask templates loaded.

parent b5787894
No related branches found
No related tags found
1 merge request!1034Resolve TMSS-2196
......@@ -259,12 +259,22 @@ const TaskService = {
return statusLogs;
},
getSubtaskTemplates: async function(templateId) {
let templates = [];
try {
const response = await axios.get(`/api/subtask_template/`);
return response.data.results;
} catch(error) {
console.error(error);
let url = '/api/subtask_template/'
let response = await axios.get(url);
const totalCount = response.data.count;
const initialCount = response.data.results.length;
templates = response.data.results;
if (totalCount > initialCount) {
url = `${url}?limit=${totalCount-initialCount}&offset=${initialCount}`;
response = await axios.get(url);
templates = templates.concat(response.data.results);
}
} catch (error) {
console.log(error);
}
return templates;
},
getSubtaskTemplate: async function(templateId) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment