Now parsing visibility
This commit is contained in:
parent
6e179766a8
commit
2556a424a1
1 changed files with 25 additions and 3 deletions
|
@ -22,7 +22,7 @@ export const jugglService = {
|
||||||
getProjects() {
|
getProjects() {
|
||||||
return apiService.post("/getProjects.php").then(r => {
|
return apiService.post("/getProjects.php").then(r => {
|
||||||
return {
|
return {
|
||||||
data: r.data,
|
data: { projects: processProjects(r.data.projects) },
|
||||||
msg: ""
|
msg: ""
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -31,7 +31,7 @@ export const jugglService = {
|
||||||
getTags() {
|
getTags() {
|
||||||
return apiService.post("/getRecordTags.php").then(r => {
|
return apiService.post("/getRecordTags.php").then(r => {
|
||||||
return {
|
return {
|
||||||
data: r.data,
|
data: { record_tags: processTags(r.data.record_tags) },
|
||||||
msg: ""
|
msg: ""
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -248,7 +248,29 @@ function processRecords(data) {
|
||||||
rec.duration = helperService.calcDurationInSeconds(rec.start_time);
|
rec.duration = helperService.calcDurationInSeconds(rec.start_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
rec.tags = Object.values(rec.tags);
|
rec.tags = processTags(Object.values(rec.tags));
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function processTags(tags) {
|
||||||
|
Object.values(tags).forEach(tag => {
|
||||||
|
if (tag.visible === "1") {
|
||||||
|
tag.visible = true;
|
||||||
|
} else {
|
||||||
|
tag.visible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
function processProjects(projects) {
|
||||||
|
Object.values(projects).forEach(pro => {
|
||||||
|
if (pro.visible === "1") {
|
||||||
|
pro.visible = true;
|
||||||
|
} else {
|
||||||
|
pro.visible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return projects;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue