new functions
This commit is contained in:
@@ -17,6 +17,7 @@ export function createPadAdapter() {
|
||||
loadInfo: headers => api(base, { headers }),
|
||||
loadColor: headers => api(`${base}/editor-color`, { headers }),
|
||||
saveColor: (headers, color) => api(`${base}/editor-color`, { method: "POST", headers, body: JSON.stringify({ color }) }),
|
||||
saveEditorSettings: (headers, settings) => api(`${base}/editor-settings`, { method: "POST", headers, body: JSON.stringify(settings) }),
|
||||
fileEndpoints: {
|
||||
list: `${base}/files`,
|
||||
upload: `${base}/files`,
|
||||
@@ -27,9 +28,9 @@ export function createPadAdapter() {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ kind: "pad", slug, password }),
|
||||
}),
|
||||
publish: (accessToken, allowTaskUpdates, unprotectPage) => api(`${base}/publish`, {
|
||||
publish: (accessToken, allowTaskUpdates, unprotectPage, enabled = true) => api(`${base}/publish`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ access_token: accessToken || null, allow_task_updates: allowTaskUpdates, unprotect_page: unprotectPage }),
|
||||
body: JSON.stringify({ access_token: accessToken || null, allow_task_updates: allowTaskUpdates, unprotect_page: unprotectPage, enabled }),
|
||||
}),
|
||||
loadHistory: accessToken => api(`${base}/history`, {
|
||||
method: "POST",
|
||||
@@ -57,6 +58,7 @@ export function createWorkspaceNoteAdapter() {
|
||||
loadInfo: headers => api(base, { headers }),
|
||||
loadColor: headers => api(`${base}/editor-color`, { headers }),
|
||||
saveColor: (headers, color) => api(`${base}/editor-color`, { method: "POST", headers, body: JSON.stringify({ color }) }),
|
||||
saveEditorSettings: (headers, settings) => api(`${base}/editor-settings`, { method: "POST", headers, body: JSON.stringify(settings) }),
|
||||
fileEndpoints: {
|
||||
list: `${base}/files`,
|
||||
upload: `${base}/files`,
|
||||
@@ -67,9 +69,9 @@ export function createWorkspaceNoteAdapter() {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ kind: "workspace", slug: workspaceSlug, password }),
|
||||
}),
|
||||
publish: (accessToken, allowTaskUpdates, unprotectPage) => api(`${base}/publish`, {
|
||||
publish: (accessToken, allowTaskUpdates, unprotectPage, enabled = true) => api(`${base}/publish`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ access_token: accessToken || null, allow_task_updates: allowTaskUpdates, unprotect_page: unprotectPage }),
|
||||
body: JSON.stringify({ access_token: accessToken || null, allow_task_updates: allowTaskUpdates, unprotect_page: unprotectPage, enabled }),
|
||||
}),
|
||||
loadHistory: accessToken => api(`${base}/history`, {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user