How to mark dirty records as clean after custom server request?

I have made a custom server request to save multiple records of different types at once, instead of saving each record individually and doing a lot of single requests at the same time. It works fine, but the records in the store are still marked as dirty.

What can I do to make sure the records are marked as clean?

I’ve found this code to mark each individual record, but it’s no good practice:

record._internalModel.send('willCommit'); 
record._internalModel._attributes = {};
record._internalModel.send('didCommit');