diff --git a/server/src/services/routines.ts b/server/src/services/routines.ts index f0147197def..9ad737f3c51 100644 --- a/server/src/services/routines.ts +++ b/server/src/services/routines.ts @@ -654,6 +654,12 @@ export function routineService( actor: Actor, options: { changeSummary?: string | null } = {}, ): Promise { + if (executor === db) { + return db.transaction(async (tx) => ( + upsertRoutineDescriptionDocument(tx as unknown as Db, routine, actor, options) + )); + } + const now = new Date(); const body = routine.description ?? ""; const existing = await getRoutineDescriptionDocument(routine.id, executor);