adding user_Type validation when updating instances
This commit is contained in:
parent
25346a03fa
commit
f94d7bc151
@ -334,6 +334,11 @@ export namespace MerchantBackend {
|
|||||||
// Merchant name corresponding to this instance.
|
// Merchant name corresponding to this instance.
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
// Type of the user (business or individual).
|
||||||
|
// Defaults to 'business'. Should become mandatory field
|
||||||
|
// in the future, left as optional for API compatibility for now.
|
||||||
|
user_type?: string;
|
||||||
|
|
||||||
// The merchant's physical address (to be put into contracts).
|
// The merchant's physical address (to be put into contracts).
|
||||||
address: Location;
|
address: Location;
|
||||||
|
|
||||||
|
@ -98,6 +98,11 @@ export function UpdatePage({
|
|||||||
|
|
||||||
const errors: FormErrors<Entity> = {
|
const errors: FormErrors<Entity> = {
|
||||||
name: !value.name ? i18n.str`required` : undefined,
|
name: !value.name ? i18n.str`required` : undefined,
|
||||||
|
user_type: !value.user_type
|
||||||
|
? i18n.str`required`
|
||||||
|
: value.user_type !== "business" && value.user_type !== "individual"
|
||||||
|
? i18n.str`should be business or individual`
|
||||||
|
: undefined,
|
||||||
payto_uris:
|
payto_uris:
|
||||||
!value.payto_uris || !value.payto_uris.length
|
!value.payto_uris || !value.payto_uris.length
|
||||||
? i18n.str`required`
|
? i18n.str`required`
|
||||||
|
Loading…
Reference in New Issue
Block a user