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
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:
parent
cb781741f3
commit
a527dccd71
1 changed files with 4 additions and 3 deletions
|
|
@ -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) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue