How to make an if statement in jQuery done?

When on a table at the end of the reload element and there are two Function resetUser and resetSer. cause you need depending new is a record or has already been created for this check whether the specified id
handleSubmit(e) {
var that = this;
jQuery.post(
MyAjax.ajaxurl,
....
).done(
 if (that.state.id == null) that.props.resetSer
 else that.props.resetUser
);
}

Separately everything works fine
jQuery.post(
....
).done( that.props.resetSer)// or the second function

How to insert a check?
Tried at done to insert the function and inside the test, but it doesn't work.
July 9th 19 at 13:31

Find more questions by tags JavaScriptjQuery