แก้ไขบัค

This commit is contained in:
Thanit Konmek 2023-07-13 10:50:12 +07:00
parent a2ac793131
commit f9fac262ef
10 changed files with 174 additions and 152 deletions

View file

@ -125,13 +125,13 @@ const fetchPrefix = async () => {
};
const addChildren = async () => {
familyData.value.childrens.push({
id: `${familyData.value.childrens.length + 1}`,
childrenPrefixId: "",
childrenFirstName: "",
childrenLastName: "",
childrenCareer: "",
});
// familyData.value.childrens.push({
// id: `${familyData.value.childrens.length + 1}`,
// childrenPrefixId: "",
// childrenFirstName: "",
// childrenLastName: "",
// childrenCareer: "",
// });
familyData.value.childrens.sort(
(a: childrenFamily, b: childrenFamily) => Number(b.id) - Number(a.id)
@ -154,26 +154,26 @@ const fetchHistory = async () => {
.then((res) => {
const data: ResponseObject[] = res.data.result;
data.map((row: ResponseObject) => {
const arrayData: ResponseHistory = {
couple: row.couple ? "1" : "0",
couplePrefixId: row.couplePrefixId,
coupleFirstName: row.coupleFirstName,
coupleLastName: row.coupleLastName,
coupleLastNameOld: row.coupleLastNameOld,
coupleCareer: row.coupleCareer,
fatherPrefixId: row.fatherPrefixId,
fatherFirstName: row.fatherFirstName,
fatherLastName: row.fatherLastName,
fatherCareer: row.fatherCareer,
motherPrefixId: row.motherPrefixId,
motherFirstName: row.motherFirstName,
motherLastName: row.motherLastName,
motherCareer: row.motherCareer,
childrens: row.childrens,
createdFullName: row.createdFullName,
createdAt: new Date(row.createdAt),
};
familyDataHistory.value.push(arrayData);
// const arrayData: ResponseHistory = {
// couple: row.couple ? "1" : "0",
// couplePrefixId: row.couplePrefixId,
// coupleFirstName: row.coupleFirstName,
// coupleLastName: row.coupleLastName,
// coupleLastNameOld: row.coupleLastNameOld,
// coupleCareer: row.coupleCareer,
// fatherPrefixId: row.fatherPrefixId,
// fatherFirstName: row.fatherFirstName,
// fatherLastName: row.fatherLastName,
// fatherCareer: row.fatherCareer,
// motherPrefixId: row.motherPrefixId,
// motherFirstName: row.motherFirstName,
// motherLastName: row.motherLastName,
// motherCareer: row.motherCareer,
// childrens: row.childrens,
// createdFullName: row.createdFullName,
// createdAt: new Date(row.createdAt),
// };
// familyDataHistory.value.push(arrayData);
});
})
.catch((e) => {