只读查询不再要求同源操作意图,写操作仍需;前端改为直接消费已解包的 data。 调度集成测试按租户清理并要求一次性测试库,避免误清正式数据。
This commit is contained in:
@@ -100,7 +100,7 @@ const endpoint = (path: string, week?: string) =>
|
||||
const headers = { 'Content-Type': 'application/json', 'X-Governance-Action': 'qa-weekly-mail' }
|
||||
|
||||
export async function fetchWeeklyMailSettings(): Promise<WeeklyMailSettings> {
|
||||
return parseWeeklyMailSettings(((await getPayload(endpoint('settings'))) as { data: unknown }).data)
|
||||
return parseWeeklyMailSettings(await getPayload(endpoint('settings')))
|
||||
}
|
||||
|
||||
export async function saveWeeklyMailSettings(
|
||||
@@ -127,12 +127,12 @@ export async function saveWeeklyMailSettings(
|
||||
enabled: form.enabled,
|
||||
}),
|
||||
})
|
||||
return parseWeeklyMailSettings((payload as { data: unknown }).data)
|
||||
return parseWeeklyMailSettings(payload)
|
||||
}
|
||||
|
||||
export async function fetchWeeklyMailConfirmation(week: string): Promise<WeeklyMailConfirmation | null> {
|
||||
const payload = await getPayload(endpoint('confirmations', week))
|
||||
return parseWeeklyMailConfirmation((payload as { data: { confirmation: unknown } }).data.confirmation, week)
|
||||
const payload = (await getPayload(endpoint('confirmations', week))) as { confirmation: unknown }
|
||||
return parseWeeklyMailConfirmation(payload.confirmation, week)
|
||||
}
|
||||
|
||||
export async function confirmWeeklyMail(week: string, confirm: boolean): Promise<WeeklyMailConfirmation | null> {
|
||||
@@ -140,12 +140,14 @@ export async function confirmWeeklyMail(week: string, confirm: boolean): Promise
|
||||
method: confirm ? 'POST' : 'DELETE',
|
||||
headers,
|
||||
})
|
||||
return parseWeeklyMailConfirmation((payload as { data: { confirmation: unknown } }).data.confirmation, week)
|
||||
return parseWeeklyMailConfirmation((payload as { confirmation: unknown }).confirmation, week)
|
||||
}
|
||||
|
||||
export async function fetchWeeklyMailSends(week: string): Promise<WeeklyMailSend[]> {
|
||||
const payload = await getPayload(endpoint('sends') + '?' + new URLSearchParams({ week }).toString())
|
||||
return parseWeeklyMailSends((payload as { data: { sends: unknown } }).data.sends)
|
||||
const payload = (await getPayload(endpoint('sends') + '?' + new URLSearchParams({ week }).toString())) as {
|
||||
sends: unknown
|
||||
}
|
||||
return parseWeeklyMailSends(payload.sends)
|
||||
}
|
||||
|
||||
export const weeklyMailWeekdayLabels = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
|
||||
Reference in New Issue
Block a user