Этому вызову соответствует No Overload, VS Code Node.js, TypeScrip | я новичок в коде VS - PullRequest
0 голосов
/ 04 августа 2020

при выполнении команды в коде VS npm start это дает мне следующие ошибки, кто-нибудь, кто является экспертом в Node.js TypeScrip, пожалуйста, помогите мне устранить ошибки. Вот код, который я получаю в консоли VS Code

    src/auth/notification/services/notification.service.ts:47:9 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Type '{}' is missing the following properties from type '{ type: string; itemId: string; }': type, itemId

47         data,
           ~~~~



src/auth/notification/notification.model.ts:22:3
    22   data: {
         ~~~~
    The expected type comes from property 'data' which is declared here on type 'Pick<{ body: string; data: { type: string; itemId: string; }; _id: any; userId: string; title: string; at: string | number | Date; isRead: string | number | boolean; } & { _id: any; }, "body" | ... 4 more ... | "isRead"> & { ...; }'
  node_modules/@types/mongoose/index.d.ts:3285:5
    3285     create<TCreate = T>(...docs: CreateQuery<TCreate>[]): Promise<T>;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The last overload is declared here.

src/auth/service-provider/service-provider.service.ts:207:33 - error TS2322: Type '{ _id: any; }' is not assignable to type 'Partial<{ date: string; isOpen: boolean; extraCharges: number; }> | { date?: QuerySelector<string>; isOpen?: QuerySelector<boolean>; extraCharges?: QuerySelector<...>; }'.
  Object literal may only specify known properties, and '_id' does not exist in type 'Partial<{ date: string; isOpen: boolean; extraCharges: number; }> | { date?: QuerySelector<string>; isOpen?: QuerySelector<boolean>; extraCharges?: QuerySelector<...>; }'.

207       { $p

ull: { specialDays: { _id: dayId } } }
                                    ~~~~~~~~~~

src/auth/service-provider/service-provider.service.ts:217:46 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ phoneNumber: any; }' is not assignable to parameter of type 'Pick<{ name: string; _id: any; email: string; phoneNumber: string; fcmToken: string; businessTitle: string; profileImage: string; code: string; isVerified: string | number | boolean; isApproved: string | ... 1 more ... | boolean; ... 4 more ...; specialDays: { ...; }[]; } & { ...; }, "name" | ... 12 more ... | "spec...'.
      Type '{ phoneNumber: any; }' is missing the following properties from type 'Pick<{ name: string; _id: any; email: string; phoneNumber: string; fcmToken: string; businessTitle: string; profileImage: string; code: string; isVerified: string | number | boolean; isApproved: string | ... 1 more ... | boolean; ... 4 more ...; specialDays: { ...; }[]; } & { ...; }, "name" | ... 12 more ... | "spec...': name, email, fcmToken, businessTitle, and 9 more.

217     return await this.serviceProvider.create({ phoneNumber });
                                                 ~~~~~~~~~~~~~~~

  node_modules/@types/mongoose/index.d.ts:3285:5
    3285     create<TCreate = T>(...docs: CreateQuery<TCreate>[]): Promise<T>;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The last overload is declared here.

[12:37:32 PM] Found 3 errors. Watching for file changes.
...