I have a function with the following parameter:
const handleAccount = (
account: Partial<IAccountDocument>,
...
) => { ... }
In no way can I change the interface for IAccountDocument
to not require certain fields, i.e. I must use Partial<>
. How can I make it so that IAccountDocument
has specific fields included whilst also being allowed to be partially created?
Partial<IAccountDocument>
? – Elbertelberta_id
, for example. If I don't set the parameter asPartial<>
, it complains that it requires a document with the_id
field; but if I do set the parameter toPartial<>
, it allows documents without_id
, which cannot happen. – Cavan