Skip to content

Commit

Permalink
Update error target to recommended syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
aledalgrande committed Sep 4, 2024
1 parent c449212 commit 6d401f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function run(input) {
.filter(({ quantity }) => quantity > 1)
.map(() => ({
localizedMessage: "Not possible to order more than one of each",
target: "cart",
target: "$.cart",
}));

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

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('cart checkout validation function', () => {
const expected = /** @type {FunctionRunResult} */ ({ errors: [
{
localizedMessage: "Not possible to order more than one of each",
target: "cart"
target: "$.cart"
}
] });

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

Expand Down
4 changes: 2 additions & 2 deletions checkout/rust/cart-checkout-validation/default/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> {
{
errors.push(output::FunctionError {
localized_message: "Not possible to order more than one of each".to_owned(),
target: "cart".to_owned(),
target: "$.cart".to_owned(),
})
}
Ok(output::FunctionRunResult { errors })
Expand Down Expand Up @@ -51,7 +51,7 @@ mod tests {
let expected = FunctionRunResult {
errors: vec![FunctionError {
localized_message: "Not possible to order more than one of each".to_owned(),
target: "cart".to_owned(),
target: "$.cart".to_owned(),
}],
};

Expand Down

0 comments on commit 6d401f0

Please sign in to comment.