Skip to content

Commit

Permalink
fix(core): remove id from patch when using server actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed May 23, 2024
1 parent 79a79a3 commit 0abd48f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ export default defineConfig([
basePath: '/test',
icon: SanityMonogram,
// eslint-disable-next-line camelcase
__internal_serverDocumentActions: {},
__internal_serverDocumentActions: {
enabled: true,
},
scheduledPublishing: {
enabled: true,
inputDateTimeFormat: 'MM/dd/yy h:mm a',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {type SanityClient} from '@sanity/client'
import {type Mutation} from '@sanity/mutator'
import {type SanityDocument} from '@sanity/types'
import {omit} from 'lodash'
import {EMPTY, from, merge, type Observable, Subject} from 'rxjs'
import {filter, map, mergeMap, share, take, tap} from 'rxjs/operators'

Expand Down Expand Up @@ -121,7 +122,7 @@ function toActions(idPair: IdPair, mutationParams: Mutation['params']) {
actionType: 'sanity.action.document.edit',
draftId: idPair.draftId,
publishedId: idPair.publishedId,
patch: mutations.patch,
patch: omit(mutations.patch, 'id'),
}
}
throw new Error('Todo: implement')
Expand Down

0 comments on commit 0abd48f

Please sign in to comment.