[WIP] Доработал форму состояния зубов

This commit is contained in:
DwCay
2023-06-02 16:04:57 +03:00
parent 0d1d704b09
commit e55176efdc
4 changed files with 54 additions and 27 deletions

View File

@@ -56,13 +56,19 @@ export function getConfidantObject(data) {
}
export const getFiiledConditions = (condition) => {
let filledConditions = [
...Object.values(condition.crown)
.filter((val) => val.length)
.flat(),
...Object.values(condition.root)
.filter((val) => val.length)
.flat(),
];
return filledConditions;
let crown = Object.keys(condition.crown)
.map((key) => ({
value: condition.crown[key],
type: "crown",
part: key,
}))
.filter((el) => el.value.length);
let root = Object.keys(condition.root)
.map((key) => ({
value: condition.root[key],
type: "root",
part: key,
}))
.filter((el) => el.value.length);
return [...crown, ...root];
};