storyblok / storyblok-js-client

Universal JavaScript client for Storyblok's API
MIT License
122 stars 86 forks source link

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

Open wireless25 opened 2 months ago

wireless25 commented 2 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 3 weeks ago

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