|
@@ -28,6 +28,10 @@ const EditForm = ({record, models={}, model, options=defaultAdminOptions, Compon
|
|
|
|
|
|
if (!record) return <></>
|
|
|
|
|
|
+ if (!record.save || !record._id){
|
|
|
+ Object.assign(record, edit)
|
|
|
+ }
|
|
|
+
|
|
|
const fields = model.fields
|
|
|
const onlyInputs = model.inputs.filter(input => !fields.find(field => field.name === input.name))
|
|
|
return (
|
|
@@ -53,13 +57,14 @@ const EditForm = ({record, models={}, model, options=defaultAdminOptions, Compon
|
|
|
|
|
|
</tbody>
|
|
|
</table>
|
|
|
+ {record._id && record.save &&
|
|
|
<button onClick={() => {
|
|
|
Object.assign(record, edit);
|
|
|
if ('_id' in record && 'save' in record)
|
|
|
record.save()
|
|
|
}}>
|
|
|
Save
|
|
|
- </button>
|
|
|
+ </button>}
|
|
|
</>
|
|
|
)
|
|
|
}
|