ข้อมูลบุคคล: ต่อAPI

This commit is contained in:
oat 2024-02-05 14:04:00 +07:00
parent 47e96ddec5
commit 338c2a3b7d
12 changed files with 415 additions and 198 deletions

View file

@ -10,7 +10,8 @@ const { date2Thai } = useCounterMixin();
export const usePersonalDataStore = defineStore("PersonalData", () => {
const row = ref<DataRow[]>([]);
function fetchData(data: DataResponse[]) {
function save(data: DataResponse[]) {
const list = data.map((e) => ({
...e,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
@ -19,7 +20,7 @@ export const usePersonalDataStore = defineStore("PersonalData", () => {
row.value = list;
}
return {
fetchData,
save,
row,
};
});