storyblok / storyblok-js-client

Universal JavaScript client for Storyblok's API
MIT License
129 stars 87 forks source link

Type error when specifying an asset folder for signed response object #825

Open wireless25 opened 5 months ago

wireless25 commented 5 months ago

When using the JS client to request a signed response object to upload a file via management API, there is a type error when specifying an asset folder.


Expected Behavior

I expect to not get a type error in my IDE

Current Behavior

I get a type error

Steps to Reproduce

Following the documentation I set up a request to get a signed response object to upload a file via management API. When I specify an asset folder id, I get a type error in VS Code

const spaceId = '<SPACE_ID>'
const pat = '<PAT>'
const Storyblok = new StoryblokClient({
  oauthToken: pat,
})

await Storyblok.post(`spaces/${spaceId}}/assets`, {
  asset_folder_id: 123, // here is the type error "only specify known properties"
  filename: 'your_file.jpg',
  size: '640x359',
  validate_upload: 1,
})

type-error-sb-mapi

wireless25 commented 4 months ago

Hi there, any update on that issue? Is somebody else able to reproduce it?

alvarosabu commented 3 months ago

duplicate of #528