作者:loki230
项目:html5-experimen
return executeWithWip(context, async () => {
const taskDto: TaskDto = {
id: task.id,
text: task.text,
};
await dataAccessService.putTask(taskDto);
await loadTasksImpl(context);
});
作者:loki230
项目:html5-experimen
async function loadTasksImpl(context: AppStateActionContext) {
const taskDtos = await dataAccessService.getTasks();
const tasks: Task[] = taskDtos.map((t) => ({
id: t.id,
text: t.text,
}));
context.commit(SET_TASKS, tasks);
}