storyblok-js-client icon indicating copy to clipboard operation
storyblok-js-client copied to clipboard

Type error when specifying an asset folder for signed response object

Open wireless25 opened this issue 8 months ago • 2 comments

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 avatar Jun 03 '24 12:06 wireless25