Skip to main content

Function: oneOrFail()

oneOrFail<C, I, RawData, Data, Deserialized, Next>(transform?): (action) => Promise<Next>

Run the action and deserialize one model's instance. Throw an "ExpectedRunFailureError" when not found or empty result.

Type parameters

C extends object

I extends never

RawData

Data

Deserialized extends DeserializedData <ModelInstance>

Next = I

Parameters

transform?

Returns

Function

Parameters

action: Action<C & ConsumeAdapter<RawData, Data> & ConsumeDeserializer<NonNullable<Data>, Deserialized>, any>

Returns

Promise<Next>

Source

packages/core/src/actions/context/runners/oneOrFail.ts:36