Split up account update logic.
This commit is contained in:
1 parent
d4abe51331
commit
5fb1f08df8
3 files changed
+66
-56
No files matched your search
@@ -33,7 +33,8 @@ export default function AccountEditForm({ values, onSave, onClose }) {
|
||||
const [message, setMessage] = useState();
|
||||
|
||||
const handleSubmit = async values => {
|
||||
const { ok, data } = await post('/account', values);
|
||||
const { user_id } = values;
|
||||
const { ok, data } = await post(user_id ? `/account/${user_id}` : '/account', values);
|
||||
|
||||
if (ok) {
|
||||
onSave();
|
||||
|
||||
Reference in new issue
Block a user