Skip to content

Commit

Permalink
fix(csm): allow passing a string path
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 13, 2023
1 parent f389465 commit c6c27b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/csm/createEditUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export function createEditUrl(options: CreateEditUrlOptions): `${StudioBaseUrl}$
// eslint-disable-next-line no-warning-comments
// @TODO allow passing draft prefixed IDs, to better open the right perspective mode
const id = getPublishedId(_id)
const stringifiedPath = studioPath.toString(jsonPathToStudioPath(path))
const stringifiedPath = Array.isArray(path)
? studioPath.toString(jsonPathToStudioPath(path))
: path

// eslint-disable-next-line no-warning-comments
// @TODO Using searchParams as a temporary workaround until `@sanity/overlays` can decode state from the path reliably
Expand Down
2 changes: 1 addition & 1 deletion src/csm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface CreateEditUrlOptions {
tool?: string
id: string
type: string
path: ContentSourceMapParsedPath
path: ContentSourceMapParsedPath | string
}

/** @alpha */
Expand Down

0 comments on commit c6c27b8

Please sign in to comment.