Fix types

This commit is contained in:
Adria Navarro 2024-07-22 18:05:11 +02:00
parent 2839bd5ece
commit 5c41b372f3
1 changed files with 2 additions and 2 deletions

View File

@ -254,7 +254,7 @@ async function checkForWebhooks({ oldAuto, newAuto }: any) {
return newAuto return newAuto
} }
function trimUnexpectedObjectFields(automation: Automation): Automation { function trimUnexpectedObjectFields<T extends Automation>(automation: T): T {
const result: RequiredKeys<Automation> = { const result: RequiredKeys<Automation> = {
_id: automation._id, _id: automation._id,
_rev: automation._rev, _rev: automation._rev,
@ -271,5 +271,5 @@ function trimUnexpectedObjectFields(automation: Automation): Automation {
createdAt: automation.createdAt, createdAt: automation.createdAt,
updatedAt: automation.updatedAt, updatedAt: automation.updatedAt,
} }
return result return result as T
} }