diff --git a/auth-web/src/store/modules/business.ts b/auth-web/src/store/modules/business.ts index 2b385dd030..1fcedb0e8f 100644 --- a/auth-web/src/store/modules/business.ts +++ b/auth-web/src/store/modules/business.ts @@ -208,6 +208,17 @@ export default class BusinessModule extends VuexModule { return OrgService.createNRAffiliation(this.currentOrganization.id, requestBody) } + private addBusinessTypeforSP (filingBody: BusinessRequest, business: Business) { + // add in Business Type for SP + if (business.nameRequest.legalType === CorpTypes.SOLE_PROP) { + if (business.nameRequest.entityTypeCd === NrEntityType.FR) { + filingBody.filing.registration.businessType = CorpTypes.SOLE_PROP + } else if (business.nameRequest.entityTypeCd === NrEntityType.DBA) { + filingBody.filing.registration.businessType = NrEntityType.DBA + } + } + } + @Action({ rawError: true }) public async createNamedBusiness ({ filingType, business }: { filingType: FilingTypes, business: Business}) { let filingBody: BusinessRequest = null @@ -233,13 +244,7 @@ export default class BusinessModule extends VuexModule { } // add in Business Type for SP - if (business.nameRequest.legalType === CorpTypes.SOLE_PROP) { - if (business.nameRequest.entityTypeCd === NrEntityType.FR) { - filingBody.filing.registration.businessType = CorpTypes.SOLE_PROP - } else if (business.nameRequest.entityTypeCd === NrEntityType.DBA) { - filingBody.filing.registration.businessType = NrEntityType.DBA - } - } + this.addBusinessTypeforSP(filingBody, business) break } @@ -263,13 +268,7 @@ export default class BusinessModule extends VuexModule { } // add in Business Type for SP - if (business.nameRequest.legalType === CorpTypes.SOLE_PROP) { - if (business.nameRequest.entityTypeCd === NrEntityType.FR) { - filingBody.filing.registration.businessType = CorpTypes.SOLE_PROP - } else if (business.nameRequest.entityTypeCd === NrEntityType.DBA) { - filingBody.filing.registration.businessType = NrEntityType.DBA - } - } + this.addBusinessTypeforSP(filingBody, business) break } }