Add first business article and article layout

This commit is contained in:
2026-05-21 12:14:46 -05:00
parent 200e14e2e9
commit 4735704c6f
9617 changed files with 988627 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { pipelineSymbol } from "../../../core/constants.js";
import { ActionCalledFromServerError } from "../../../core/errors/errors-data.js";
import { AstroError } from "../../../core/errors/errors.js";
import { createGetActionPath, createActionsProxy } from "../client.js";
import { shouldAppendTrailingSlash } from "virtual:astro:actions/options";
import { ACTION_QUERY_PARAMS } from "../../consts.js";
import { ActionError, isActionError, isInputError } from "../client.js";
import { defineAction, getActionContext } from "../server.js";
const getActionPath = createGetActionPath({
baseUrl: import.meta.env.BASE_URL,
shouldAppendTrailingSlash
});
const actions = createActionsProxy({
handleAction: async (param, path, context) => {
const pipeline = context ? Reflect.get(context, pipelineSymbol) : void 0;
if (!pipeline) {
throw new AstroError(ActionCalledFromServerError);
}
const action = await pipeline.getAction(path);
if (!action) throw new Error(`Action not found: ${path}`);
return action.bind(context)(param);
}
});
export {
ACTION_QUERY_PARAMS,
ActionError,
actions,
defineAction,
getActionContext,
getActionPath,
isActionError,
isInputError
};