Skip to content

Commit 23086e2

Browse files
jordanl17ricokahler
authored andcommitted
refactor(core): minor type usage improvement and using task plugin name (#7453)
* refactor(core): improved typescript usage of collate for use with collecting drafts * refactor(tasks): tasks plugin name uses var
1 parent e6b0614 commit 23086e2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/sanity/src/core/form/studio/inputs/client-adapters/reference.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ export function getReferenceInfo(
131131
)
132132

133133
const value$ = combineLatest([draftPreview$, publishedPreview$]).pipe(
134-
map(([draft, published]) => ({draft, published})),
134+
map(([draft, published]) => ({
135+
draft,
136+
published,
137+
})),
135138
)
136139

137140
return value$.pipe(
@@ -144,7 +147,6 @@ export function getReferenceInfo(
144147
pairAvailability.published.reason === 'PERMISSION_DENIED'
145148
? PERMISSION_DENIED
146149
: NOT_FOUND
147-
148150
return {
149151
type: typeName,
150152
id: publishedId,
@@ -201,7 +203,7 @@ export function referenceSearch(
201203
})
202204
return search(textTerm, {includeDrafts: true}).pipe(
203205
map(({hits}) => hits.map(({hit}) => hit)),
204-
map(collate),
206+
map((docs) => collate(docs)),
205207
// pick the 100 best matches
206208
map((collated) => collated.slice(0, 100)),
207209
mergeMap((collated) => {

packages/sanity/src/core/form/studio/inputs/crossDatasetReference/datastores/search.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function search(
3131
isCrossDataset: true,
3232
}).pipe(
3333
map(({hits}) => hits.map(({hit}) => hit)),
34-
map(collate),
34+
map((docs) => collate(docs)),
3535
map((collated) =>
3636
collated.map((entry) => ({
3737
id: entry.id,

packages/sanity/src/core/tasks/plugin/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const TASKS_NAME = 'sanity/tasks'
1818
* @beta
1919
*/
2020
export const tasks = definePlugin({
21-
name: 'sanity/tasks',
21+
name: TASKS_NAME,
2222
// eslint-disable-next-line camelcase
2323
__internal_tasks: {
2424
footerAction: <TasksFooterOpenTasks />,

0 commit comments

Comments
 (0)