Skip to content

Commit e922262

Browse files
authored
Merge pull request #554 from Shopify/alessandro/update-error-target
Update error target to recommended syntax
2 parents c449212 + 6d401f0 commit e922262

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

checkout/javascript/cart-checkout-validation/default/src/run.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function run(input) {
1515
.filter(({ quantity }) => quantity > 1)
1616
.map(() => ({
1717
localizedMessage: "Not possible to order more than one of each",
18-
target: "cart",
18+
target: "$.cart",
1919
}));
2020

2121
return {
@@ -34,7 +34,7 @@ export function run(input: RunInput): FunctionRunResult {
3434
.filter(({ quantity }) => quantity > 1)
3535
.map(() => ({
3636
localizedMessage: "Not possible to order more than one of each",
37-
target: "cart",
37+
target: "$.cart",
3838
}));
3939

4040
return {

checkout/javascript/cart-checkout-validation/default/src/run.test.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('cart checkout validation function', () => {
2020
const expected = /** @type {FunctionRunResult} */ ({ errors: [
2121
{
2222
localizedMessage: "Not possible to order more than one of each",
23-
target: "cart"
23+
target: "$.cart"
2424
}
2525
] });
2626

@@ -61,7 +61,7 @@ describe('cart checkout validation function', () => {
6161
const expected: FunctionRunResult = { errors: [
6262
{
6363
localizedMessage: "Not possible to order more than one of each",
64-
target: "cart"
64+
target: "$.cart"
6565
}
6666
] };
6767

checkout/rust/cart-checkout-validation/default/src/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> {
1919
{
2020
errors.push(output::FunctionError {
2121
localized_message: "Not possible to order more than one of each".to_owned(),
22-
target: "cart".to_owned(),
22+
target: "$.cart".to_owned(),
2323
})
2424
}
2525
Ok(output::FunctionRunResult { errors })
@@ -51,7 +51,7 @@ mod tests {
5151
let expected = FunctionRunResult {
5252
errors: vec![FunctionError {
5353
localized_message: "Not possible to order more than one of each".to_owned(),
54-
target: "cart".to_owned(),
54+
target: "$.cart".to_owned(),
5555
}],
5656
};
5757

0 commit comments

Comments
 (0)