优化训练计划列表接口返回结构,将数据包装为对象形式,包含列表、总数、页码和限制信息。
This commit is contained in:
@@ -66,15 +66,17 @@ export class TrainingPlansService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data: rows.map(r => ({
|
data: {
|
||||||
id: r.id,
|
list: rows.map(r => ({
|
||||||
createdAt: r.createdAt,
|
id: r.id,
|
||||||
startDate: r.startDate,
|
createdAt: r.createdAt,
|
||||||
goal: r.goal,
|
startDate: r.startDate,
|
||||||
})),
|
goal: r.goal,
|
||||||
total: count,
|
})),
|
||||||
page,
|
total: count,
|
||||||
limit,
|
page,
|
||||||
|
limit,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user