PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | js/hooks/useSnippetsAPI.tsx +3 -3 3.10.0-beta.2 → trunk View file →
@@ -5,9 +5,9 @@
5 5 import { buildUrl } from '../utils/urls'
6 6 import { useRestAPI } from './useRestAPI'
7 7 import type { Snippet } from '../types/Snippet'
8 8 import type { SnippetsExport } from '../types/schema/SnippetsExport'
9 -import type { SnippetSchema, WritableSnippetSchema } from '../types/schema/SnippetSchema'
9 +import type { SnippetIdentifierSchema, SnippetSchema, WritableSnippetSchema } from '../types/schema/SnippetSchema'
10 10 import type { RestAPI } from './useRestAPI'
11 11 import type { PropsWithChildren } from 'react'
12 12
13 13 export interface SnippetsAPI {
@@ -40,9 +40,9 @@
40 40 locked,
41 41 trashed,
42 42 shared_network,
43 43 conditionId
44 -}: Partial<Snippet>): WritableSnippetSchema => ({
44 +}: Partial<Snippet>): WritableSnippetSchema & Pick<SnippetIdentifierSchema, 'network'> => ({
45 45 name,
46 46 desc,
47 47 code,
48 48 tags,
@@ -72,9 +72,9 @@
72 72 update: snippet =>
73 73 post<SnippetSchema, WritableSnippetSchema>(snippet.id ? buildSnippetUrl(snippet) : REST_BASES.snippets, mapToSchema(snippet))
74 74 .then(createSnippetObject),
75 75
76 - delete: snippet =>
76 + delete: (snippet): Promise<void> =>
77 77 del(buildSnippetUrl(snippet)),
78 78
79 79 restore: snippet =>
80 80 post(buildSnippetUrl(snippet, 'restore')),