How to Restrict Listing Categories by User Role

I have checked the following code posted in previous topics. it working good for the first time when add listing button click. but when we change the category from the dropdown all hidden categories are appear again. how to resolve this issue?
your code is:

add_filter(
	'hivepress/v1/models/listing',
	function( $form ) {
		if ( ! hivepress()->helper->is_rest() && current_user_can( 'artist_user' ) ) {
			$form['fields']['categories']['option_args']['include'] = [ 121 ];
		}

		return $form;
	},
	1000
);

Hi,

Please try to remove this part in the code ! hivepress()->helper->is_rest() and check if everything works correctly. Also, please note that if you remove this part of the code, then when you reselect the categories, they will also be hidden.