Skip to main content

prepareCreateInput

@webda/core


Function: prepareCreateInput()

prepareCreateInput<T>(model, input): T

Defined in: packages/core/src/services/domainservice.service.ts:80

Client input of a create (REST, gRPC, MCP and GraphQL): sanitizeModelInput, plus

  • the parent link (ModelParent attribute, from the nested URL or the input) is kept even when _-prefixed, unless protected: the caller must then check the parent (checkModelParent);
  • a client uuid is dropped for UuidModels: the key is always generated, so a create can neither target an existing object nor reveal that a uuid exists. Natural-key models keep the client key (an existing key is a 409).

Type Parameters​

T​

T = any

Parameters​

model​

ModelClass<any>

the model class

input​

T

the raw client input

Returns​

T

the input to load in the new object