Update NewPrinter component to pass the result object to onOk callback upon successful submission, enhancing the handling of printer creation.
This commit is contained in:
parent
31f90000e4
commit
f5dffd5512
@ -96,8 +96,8 @@ const NewPrinter = ({ onOk, defaultValues }) => {
|
||||
title='New Printer'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onOk()
|
||||
if (result?._id) {
|
||||
onOk(result)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user