Minor type fixes

This commit is contained in:
francesco
2021-08-10 19:02:47 +02:00
parent ce609b16c5
commit 0edc07c2b9
3 changed files with 4 additions and 3 deletions

View File

@@ -153,8 +153,8 @@ function PopupFormField<S extends EntitySchema<Key>, Key extends string>({
const validationSchema = getYupEntitySchema(
name ?
{ [name]: schema.properties[name] } as Partial<PropertiesOrBuilder<S, Key>>
: {},
{ [name]: schema.properties[name] } as PropertiesOrBuilder<S, Key>
: {} as PropertiesOrBuilder<S, Key>,
entity?.values ?? {},
collectionPath,
customFieldValidator,

View File

@@ -82,7 +82,7 @@ export function mapPropertyToYup(propertyContext: PropertyContext<any>): AnySche
}
export function getYupEntitySchema<T extends CMSType, S extends EntitySchema<Key>, Key extends string>
(properties: Partial<PropertiesOrBuilder<S, Key>>,
(properties: PropertiesOrBuilder<S, Key>,
values: Partial<EntityValues<S, Key>>,
collectionPath: string,
customFieldValidator?: CustomFieldValidator,

View File

@@ -278,6 +278,7 @@ function sanitizeData<S extends EntitySchema<Key>,
*
* @param doc
* @param schema
* @param collectionPath
* @category Firestore
*/
export function createEntityFromSchema<S extends EntitySchema<Key>,