Make a generic updateStateAction

in ResourceController