fix(admin-ui): отправляем валидный ISO datetime в validFrom/validTo + format=date-time
500 при сохранении записи — backend ждёт OffsetDateTime в DTO CreateRecordRequest, а DatePicker отдавал просто 'yyyy-MM-dd'. Добавил helpers: - formatIsoDateTime(d) → 'yyyy-MM-ddT00:00:00Z' - ensureIsoDateTime(s) → нормализует submit-значение validFrom/validTo Применил: - validFrom/validTo на submit нормализуются (если YYYY-MM-DD → +T00:00:00Z) - format=date-time data поля отдают datetime ISO, format=date — по-прежнему YYYY-MM-DD Также добавил скаффолд для D-pack (history drawer + schema diff util) — не интегрировано в роуты, доделаем в следующем коммите.
This commit is contained in:
@@ -36,6 +36,26 @@ export const recordsQuery = (dictionaryName: string, scopeCsv: string) =>
|
||||
},
|
||||
})
|
||||
|
||||
export const recordHistoryQuery = (dictionaryName: string, businessKey: string) =>
|
||||
queryOptions({
|
||||
queryKey: ['record-history', dictionaryName, businessKey] as const,
|
||||
queryFn: async (): Promise<RecordResponse[]> => {
|
||||
const { data } = await apiClient.get<RecordResponse[]>(
|
||||
`/dictionaries/${dictionaryName}/records/${encodeURIComponent(businessKey)}/history`,
|
||||
)
|
||||
return data
|
||||
},
|
||||
})
|
||||
|
||||
export const useRecordHistory = (
|
||||
dictionaryName: string,
|
||||
businessKey: string | undefined,
|
||||
) =>
|
||||
useQuery({
|
||||
...recordHistoryQuery(dictionaryName, businessKey ?? ''),
|
||||
enabled: Boolean(businessKey),
|
||||
})
|
||||
|
||||
export const recordRawQuery = (dictionaryName: string, businessKey: string) =>
|
||||
queryOptions({
|
||||
queryKey: ['record-raw', dictionaryName, businessKey] as const,
|
||||
|
||||
Reference in New Issue
Block a user