Skip to content

Commit ee375c6

Browse files
committed
✨ Introducing node-service-api-router and node-service-api-request-handlers
1 parent 31396e9 commit ee375c6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"name": "@crystallize/js-api-client",
3+
"license": "MIT",
4+
"version": "0.3.1",
5+
"author": "Crystallize <[email protected]> (https://crystallize.com)",
6+
"contributors": [
7+
"Sébastien Morel <[email protected]>"
8+
],
29
"scripts": {
310
"watch": "yarn tsc -W",
411
"build": "yarn tsc",
@@ -24,8 +31,5 @@
2431
"tiny-invariant": "^1.2.0",
2532
"typescript": "^4.6.3",
2633
"zod": "^3.14.3"
27-
},
28-
"license": "MIT",
29-
"name": "@crystallize/js-api-client",
30-
"version": "0.3.1"
34+
}
3135
}

src/types/order.types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ export const priceInputRequest = z
3535
gross: z.number().optional(),
3636
net: z.number().optional(),
3737
currency: z.string(),
38-
discount: z.object({
39-
percent: z.number().optional()
40-
}),
38+
discount: z
39+
.object({
40+
percent: z.number().optional()
41+
})
42+
.optional(),
4143
tax: z.object({
4244
name: z.string().optional(),
4345
percent: z.number().optional()

tests/call.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('callCatalogueApi: Raw fetch Error', async () => {
4343
});
4444
} catch (exception) {
4545
expect(exception.code).toBe(400);
46-
expect(exception.message).toBe('Bad Request');
46+
expect(exception.statusText).toBe('Bad Request');
4747
}
4848
});
4949

0 commit comments

Comments
 (0)