This PR fixes the issue where the custom validator for AdminUpdateUserRequest was not being properly registered, which caused validation errors when updating user statuses in the admin UI. The fix involves correctly registering the overridden validator to ensure the status field is recognized and validated. The issue was mentioned in #30. The fix was to register the AdminUpdateUserRequest using registerOverriddenValidators to replace the core validator.
Without registering the custom AdminUpdateUserRequest, Medusa's default validation kicks in and fails to recognize the custom status field. This results in errors like:
{"type":"invalid_data","message":"property status should not exist"}
So to fix this, we have to register the custom validator as documented here. This will ensure that our extended request (with the status field) is properly validated. I tested it and the status field is now validated correctly when updating a user. Further information on extending and registering custom validators can be found in the Medusa docs.
This PR fixes the issue where the custom validator for
AdminUpdateUserRequest
was not being properly registered, which caused validation errors when updating user statuses in the admin UI. The fix involves correctly registering the overridden validator to ensure thestatus
field is recognized and validated. The issue was mentioned in #30. The fix was to register theAdminUpdateUserRequest
usingregisterOverriddenValidators
to replace the core validator.Without registering the custom
AdminUpdateUserRequest
, Medusa's default validation kicks in and fails to recognize the customstatus
field. This results in errors like:So to fix this, we have to register the custom validator as documented here. This will ensure that our extended request (with the
status
field) is properly validated. I tested it and the status field is now validated correctly when updating a user. Further information on extending and registering custom validators can be found in the Medusa docs.Example Demonstration
25af840d-8aba-4972-a0ef-2fa097c5d249.webm
a33ea09f-368a-493a-aa02-02274c4ae79b.webm