Type sdk couchdb fields
This commit is contained in:
parent
2970bfc48a
commit
4a8f15995c
|
@ -11,6 +11,11 @@ import {
|
||||||
import { definitions } from "../../../automations/triggerInfo"
|
import { definitions } from "../../../automations/triggerInfo"
|
||||||
import automations from "."
|
import automations from "."
|
||||||
|
|
||||||
|
interface PersistedAutomation extends Automation {
|
||||||
|
_id: string
|
||||||
|
_rev: string
|
||||||
|
}
|
||||||
|
|
||||||
function getDb() {
|
function getDb() {
|
||||||
return context.getAppDB()
|
return context.getAppDB()
|
||||||
}
|
}
|
||||||
|
@ -71,7 +76,7 @@ async function handleStepEvents(
|
||||||
|
|
||||||
export async function fetch() {
|
export async function fetch() {
|
||||||
const db = getDb()
|
const db = getDb()
|
||||||
const response = await db.allDocs<Automation>(
|
const response = await db.allDocs<PersistedAutomation>(
|
||||||
getAutomationParams(null, {
|
getAutomationParams(null, {
|
||||||
include_docs: true,
|
include_docs: true,
|
||||||
})
|
})
|
||||||
|
@ -81,7 +86,7 @@ export async function fetch() {
|
||||||
|
|
||||||
export async function get(automationId: string) {
|
export async function get(automationId: string) {
|
||||||
const db = getDb()
|
const db = getDb()
|
||||||
const result = await db.get<Automation>(automationId)
|
const result = await db.get<PersistedAutomation>(automationId)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue