feat(housekeeping): deliver content vertical
This commit is contained in:
1 parent
bdab924bdf
commit
fd68819d9b
67 files changed
+5742
-1916
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import "server-only";
|
||||
|
||||
import { executeContentDatabaseMutation } from "./mutation-runtime-database";
|
||||
import { executeContentExternalMutation } from "./mutation-runtime-external";
|
||||
import type {
|
||||
ContentMutationContext,
|
||||
ContentMutationOperation,
|
||||
ContentMutationSnapshot,
|
||||
} from "./mutations";
|
||||
import { ContentMutationFailure } from "./mutations";
|
||||
|
||||
export async function executeContentMutationOperation(
|
||||
operation: ContentMutationOperation,
|
||||
input: unknown,
|
||||
context: ContentMutationContext,
|
||||
transaction?: unknown,
|
||||
): Promise<ContentMutationSnapshot> {
|
||||
const databaseResult = await executeContentDatabaseMutation(
|
||||
operation,
|
||||
input,
|
||||
context,
|
||||
transaction,
|
||||
);
|
||||
if (databaseResult) return databaseResult;
|
||||
const externalResult = await executeContentExternalMutation(
|
||||
operation,
|
||||
input,
|
||||
context,
|
||||
);
|
||||
if (externalResult) return externalResult;
|
||||
throw new ContentMutationFailure(
|
||||
"VALIDATION",
|
||||
"errors.housekeeping.validation",
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user