forked from polka_billy/porridger
Fixed front ann book and delete err handling
Button no longer pre-updates on err File uploading fix
This commit is contained in:
@ -14,8 +14,8 @@ function useAddAnnouncement() {
|
||||
processPutAnnouncement
|
||||
)
|
||||
|
||||
function handleAdd(formData: FormData) {
|
||||
void doSend({}, {
|
||||
async function handleAdd(formData: FormData) {
|
||||
await doSend({}, {
|
||||
body: formData,
|
||||
})
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ function useBook() {
|
||||
processBook,
|
||||
)
|
||||
|
||||
const handleBook = useCallback((id: number) => {
|
||||
void doSend({}, {
|
||||
const handleBook = useCallback(async (id: number) => {
|
||||
await doSend({}, {
|
||||
body: JSON.stringify({
|
||||
id,
|
||||
}),
|
||||
|
@ -12,7 +12,7 @@ function useSendButtonCaption(
|
||||
const [title, setTitle] = useState(initial)
|
||||
|
||||
const update = useCallback(<T extends NonNullable<unknown>>(data: T | null | undefined) => {
|
||||
if (data !== undefined) { // not loading
|
||||
if (data !== undefined && data !== null) { // not loading or error
|
||||
setCaption(result)
|
||||
setTitle('Отправить ещё раз')
|
||||
|
||||
|
Reference in New Issue
Block a user