Open shabith opened 5 months ago
Describe the bug
I tried to disable the asset source for a specific schema following the Manually configure asset sources section in README but it is not working.
Manually configure asset sources
To Reproduce
Steps to reproduce the behavior:
image
movie-image
import { unsplashImageAsset, unsplashAssetSource } from 'sanity-plugin-asset-source-unsplash' export default defineConfig({ // ... plugins: [unsplashImageAsset()], form: { image: { assetSources: (previousAssetSources, { schema }) => { if (schema.name === 'movie-image') { // remove unsplash from movie-image types return previousAssetSources.filter((assetSource) => assetSource !== unsplashAssetSource) } return previousAssetSources }, }, }, })
Expected behavior
movie-image shouldn't have unsplash as in source dropdown
Which versions of Sanity are you using?
@sanity/cli (global) 3.29.1 (latest: 3.44.0) @sanity/astro 3.0.0 (latest: 3.1.3) @sanity/code-input 4.1.4 (up to date) @sanity/vision 3.41.1 (latest: 3.44.0) sanity 3.41.1 (latest: 3.44.0)
What operating system are you using?
Which versions of Node.js / npm are you running?
10.5.0 v20.11.0
Additional context
When I console log schema.name it returns undefined
schema.name
undefined
Describe the bug
I tried to disable the asset source for a specific schema following the
Manually configure asset sources
section in README but it is not working.To Reproduce
Steps to reproduce the behavior:
image
calledmovie-image
Expected behavior
movie-image
shouldn't have unsplash as in source dropdownWhich versions of Sanity are you using?
@sanity/cli (global) 3.29.1 (latest: 3.44.0) @sanity/astro 3.0.0 (latest: 3.1.3) @sanity/code-input 4.1.4 (up to date) @sanity/vision 3.41.1 (latest: 3.44.0) sanity 3.41.1 (latest: 3.44.0)
What operating system are you using?
Which versions of Node.js / npm are you running?
10.5.0 v20.11.0
Additional context
When I console log
schema.name
it returnsundefined