@@ -3,12 +3,9 @@ import { formChange } from '../../../../helpers/formChange'
33import { FormCard , MD_INPUT , Option , TextField } from '../../../FormCard'
44import styles from './adminLessonInputs.module.scss'
55import { isEqual } from 'lodash'
6- import {
7- ApolloError ,
8- OperationVariables ,
9- ApolloQueryResult
10- } from '@apollo/client'
6+ import { ApolloError , ApolloQueryResult } from '@apollo/client'
117import QueryInfo from '../../../QueryInfo'
8+ import { Exact } from '../../../../graphql'
129
1310export type Item = {
1411 id ?: number
@@ -18,17 +15,15 @@ export type Item = {
1815 lesson ?: { __typename ?: string ; id ?: number }
1916}
2017
21- export type Props < MainItem extends Item > = {
18+ export type Props = {
2219 lessonId : number
2320 title ?: string
2421 item ?: Item
2522 itemName ?: string
2623 loading : boolean
27- refetch : ( variables ?: Partial < OperationVariables > ) => Promise <
28- ApolloQueryResult < {
29- [ key : string ] : MainItem [ ]
30- } >
31- >
24+ refetch : (
25+ variables ?: Partial < Exact < { [ key : string ] : never } > > | undefined
26+ ) => Promise < ApolloQueryResult < any > >
3227 onActionFinish ?: (
3328 m : ( Item & { lesson : { id : number } } ) | null ,
3429 e : { name : string ; content : string ; order : number } | null
@@ -61,7 +56,7 @@ const initValues = (
6156 }
6257]
6358
64- const AdminLessonInputs = < MainItem extends Item > ( {
59+ const AdminLessonInputs = ( {
6560 title,
6661 lessonId,
6762 item,
@@ -70,7 +65,7 @@ const AdminLessonInputs = <MainItem extends Item>({
7065 refetch,
7166 onActionFinish,
7267 action
73- } : Props < MainItem > ) => {
68+ } : Props ) => {
7469 const [ formOptions , setFormOptions ] = useState < any > ( initValues ( ) )
7570 const [ name , content , order ] = formOptions
7671
0 commit comments