refactor: replace patch with delete for /api/document (#930)
This commit is contained in:
parent
c937db3050
commit
5b4ad941d3
3 changed files with 17 additions and 14 deletions
|
|
@ -57,15 +57,15 @@ export const VersionFooter = ({
|
|||
|
||||
mutate(
|
||||
`/api/document?id=${artifact.documentId}`,
|
||||
await fetch(`/api/document?id=${artifact.documentId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({
|
||||
timestamp: getDocumentTimestampByIndex(
|
||||
documents,
|
||||
currentVersionIndex,
|
||||
),
|
||||
}),
|
||||
}),
|
||||
await fetch(
|
||||
`/api/document?id=${artifact.documentId}×tamp=${getDocumentTimestampByIndex(
|
||||
documents,
|
||||
currentVersionIndex,
|
||||
)}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
},
|
||||
),
|
||||
{
|
||||
optimisticData: documents
|
||||
? [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue