Skip to content

Commit

Permalink
fix(types): adjust action types to reflect Actions API (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed May 29, 2024
1 parent a95b4a0 commit e116c62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,6 @@ export type CreateAction = {
export type ReplaceDraftAction = {
actionType: 'sanity.action.document.replaceDraft'

/**
* Draft document ID to replace, if it exists.
*/
draftId: string

/**
* Published document ID to create draft from, if draft does not exist
*/
Expand Down Expand Up @@ -621,7 +616,7 @@ export type DeleteAction = {
/**
* Delete document history
*/
purge: boolean
purge?: boolean
}

/**
Expand All @@ -641,7 +636,7 @@ export type DiscardAction = {
/**
* Delete document history
*/
purge: boolean
purge?: boolean
}

/**
Expand All @@ -664,7 +659,7 @@ export type PublishAction = {
/**
* Draft revision ID to match
*/
ifDraftRevisionId: string
ifDraftRevisionId?: string

/**
* Published document ID to replace
Expand All @@ -674,7 +669,7 @@ export type PublishAction = {
/**
* Published revision ID to match
*/
ifPublishedRevisionId: string
ifPublishedRevisionId?: string
}

/**
Expand Down
1 change: 0 additions & 1 deletion test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,6 @@ describe('client', async () => {

const action2: ReplaceDraftAction = {
actionType: 'sanity.action.document.replaceDraft',
draftId: 'drafts.post2',
publishedId: 'post2',
attributes: {_id: 'post2', _type: 'post'},
}
Expand Down

0 comments on commit e116c62

Please sign in to comment.