Function act

  • The act function converts a single config object param into a fetch request:

    const muffins = await act({
    action: "entryList",
    env: "stage",
    dmShortID: "83cc6374",
    model: "muffin",
    });

    The config object passed to act expects an action (available actions) and additional keys that are required to perform the action. If you don't know the required keys for an action, either call act without additional keys or look it up in the source. For example, this is how the entryList function looks:

    export async function entryList(config) {
    let { env, dmShortID, model, options = {} } = config;
    expect({ env, dmShortID, model });
    // more stuff
    }

    The call to expect shows which keys are expected to be set.

    Parameters

    • config: Record<string, any>

    Returns Promise<any>