Fix TS 4.0 warnings

This commit is contained in:
rijkvanzanten
2020-10-08 15:01:48 -04:00
parent 2b93b99742
commit fde1b6eaad
3 changed files with 7 additions and 5 deletions

View File

@@ -291,21 +291,21 @@ export default defineComponent({
}
await Promise.all(
state.newCollections.map((newCollection: Partial<Collection> & { $type: string }) => {
state.newCollections.map((newCollection: Partial<Collection> & { $type?: string }) => {
delete newCollection.$type;
return api.post(`/collections`, newCollection);
})
);
await Promise.all(
state.newFields.map((newField: Partial<Field> & { $type: string }) => {
state.newFields.map((newField: Partial<Field> & { $type?: string }) => {
delete newField.$type;
return api.post(`/fields/${newField.collection}`, newField);
})
);
await Promise.all(
state.updateFields.map((updateField: Partial<Field> & { $type: string }) => {
state.updateFields.map((updateField: Partial<Field> & { $type?: string }) => {
delete updateField.$type;
return api.post(`/fields/${updateField.collection}/${updateField.field}`, updateField);
})

View File

@@ -302,7 +302,7 @@ export default defineComponent({
...props.field,
field: duplicateName.value,
collection: duplicateTo.value,
};
} as Field & { name?: string; meta: { id?: number; sort?: number } };
if (newField.meta) {
delete newField.meta.id;