Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

graphQl-512: added street lines validation #562

Merged

Conversation

VitaliyBoyko
Copy link
Contributor

Description (*)

Added validation for Cart Address attribute Street and adjusted tests.

Sample query (By default the address street lines config value equals 2)

mutation {
  setBillingAddressOnCart(
    input: {
      cart_id: "QUOTE_MASK"
      billing_address: {
         address: {
          firstname: "test firstname"
          lastname: "test lastname"
          company: "test company"
          street: ["test street 1", "test street 2", "test street 3", "test street 4"]
          city: "test city"
          region: "test region"
          postcode: "887766"
          country_code: "US"
          telephone: "88776655"
          save_in_address_book: false
         }
         use_for_shipping: true
      }
    }
  ) {
    cart {
      billing_address {
        firstname
        lastname
        company
        street
        city
        postcode
        telephone
      }
    }
  }
}

Response

{
  "errors": [
    {
      "message": "\"Street Address\" cannot contain more than 2 lines.",
      "category": "graphql-input",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "setBillingAddressOnCart"
      ]
    }
  ],
  "data": {
    "setBillingAddressOnCart": null
  }
}

Fixed Issues (if relevant)

  1. address.street needs refactoring to support as many lines as defined by admin #512 : address.street needs refactoring to support as many lines as defined by admin

…dress.street-validation

# Conflicts:
#	app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php
@magento-engcom-team magento-engcom-team merged commit 722afe3 into 2.3-develop Apr 9, 2019
@ghost
Copy link

ghost commented Apr 9, 2019

Hi @VitaliyBoyko, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants