Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts can't figure out strapi interface #268

Closed
Slepzs opened this issue Jul 31, 2022 · 1 comment
Closed

ts can't figure out strapi interface #268

Slepzs opened this issue Jul 31, 2022 · 1 comment
Labels
question Further information is requested

Comments

@Slepzs
Copy link

Slepzs commented Jul 31, 2022

I cannot get this error to disappear, even though it works.

I have a interface

 export interface Wine {
    id?: string;
    name?: string;
    producent?: string;
    country?: string;
    type?: string;
    drue?: string;
    flstr?: string;
    alkohol?: number;
  }

and a submit request

const onSubmit = async () => {
  const wine_data = {
      name: wine_name.value,
      producent: wine_producent.value,
      country: country.value,
      type: type.value,
      drue: drue.value,
      flstr: flStr.value,
      alkohol: parseInt(alkohol.value),
  }  
  await create<Strapi4Response<Wine>>('wines', {...wine_data as Wine });
}

But i keep getting this error

Type '{ id?: string; name?: string; producent?: string; country?: string; type?: string; drue?: string; flstr?: string; alkohol?: number; }' has no properties in common with type 'Partial<Strapi4Response<Wine>>'

Whats up with that? Thanks!

@Slepzs Slepzs added the question Further information is requested label Jul 31, 2022
@Slepzs Slepzs changed the title Type has no properties in common with type 'Partial<Strapi4Response<Wine>>' Strapi can't figure out interface Jul 31, 2022
@Slepzs Slepzs changed the title Strapi can't figure out interface ts can't figure out strapi interface Jul 31, 2022
@harlan-zw
Copy link
Contributor

This should be sorted with https://github.com/nuxt-modules/strapi/releases/tag/v1.6.0 and can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants