fix
Some checks failed
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Admin Panel / Deploy Admin Panel (push) Has been cancelled
Deploy Admin Panel / Admin Panel Verification (push) Has been cancelled

This commit is contained in:
Dmitry 2026-01-10 21:53:23 +03:00
parent cb781741f3
commit a527dccd71

View file

@ -2,7 +2,7 @@ import { useState } from 'react'
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner' import { toast } from 'sonner'
import { tasksApi } from '@/api/tasks' import { tasksApi } from '@/api/tasks'
import type { TaskDto, TaskFilters, PaginatedResponse } from '@/types/models' import type { TaskDto, TaskFilters, PaginatedResponse, CreateTaskDto, UpdateTaskDto } from '@/types/models'
import type { AxiosError } from 'axios' import type { AxiosError } from 'axios'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input' import { Input } from '@/components/ui/input'
@ -128,9 +128,10 @@ export default function TasksPage() {
}) })
const handleCreate = async ( const handleCreate = async (
taskData: Parameters<typeof tasksApi.createTask>[0] taskData: CreateTaskDto | UpdateTaskDto
) => { ) => {
await createMutation.mutateAsync(taskData) // When creating, all required fields are present, so we can safely cast
await createMutation.mutateAsync(taskData as CreateTaskDto)
} }
const handleEdit = (task: TaskDto) => { const handleEdit = (task: TaskDto) => {