修复日报分析建议接口返回类型不一致的问题。当接口返回数组类型时,将其包装为包含 suggestions 字段的对象,以保持前端数据结构的统一性。
This commit is contained in:
@@ -369,11 +369,9 @@ export const getDailyReportAnalysisSuggestions = (params: {
|
||||
reportDate?: string;
|
||||
submitterUsername?: string;
|
||||
}) => {
|
||||
return http.request<Result<DailyReportAnalysisSuggestionsVO>>(
|
||||
"get",
|
||||
"/api/v1/daily-report/analysis/suggestions",
|
||||
{ params }
|
||||
);
|
||||
return http.request<
|
||||
Result<DailyReportAnalysisSuggestionsVO | DailyReportUpdateSuggestionVO[]>
|
||||
>("get", "/api/v1/daily-report/analysis/suggestions", { params });
|
||||
};
|
||||
|
||||
export type ApplyDailyReportSuggestionsRequest = {
|
||||
|
||||
@@ -568,7 +568,10 @@ async function fetchDailyReportSuggestions() {
|
||||
});
|
||||
const result = res as any;
|
||||
if (result.code === 200) {
|
||||
dailyReportSuggestions.value = result.data || null;
|
||||
const data = result.data;
|
||||
dailyReportSuggestions.value = Array.isArray(data)
|
||||
? { suggestions: data }
|
||||
: data || null;
|
||||
selectedSuggestionIds.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user