btrz-api-client 8.24.0 → 8.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,7 +62,8 @@ function pdfDataFactory(_ref) {
|
|
|
62
62
|
if (query.type === "manifest") {
|
|
63
63
|
url = "/pdf-manifests/" + itemId;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
var orderTypes = ["order", "order_confirmation", "cancellation", "change"];
|
|
66
|
+
if (orderTypes.includes(query.type)) {
|
|
66
67
|
url = "/pdf-orders/" + itemId;
|
|
67
68
|
}
|
|
68
69
|
if (query.type === "shift") {
|
package/package.json
CHANGED
|
@@ -60,7 +60,8 @@ function pdfDataFactory({
|
|
|
60
60
|
if (query.type === "manifest") {
|
|
61
61
|
url = `/pdf-manifests/${itemId}`;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
const orderTypes = ["order", "order_confirmation", "cancellation", "change"];
|
|
64
|
+
if (orderTypes.includes(query.type)) {
|
|
64
65
|
url = `/pdf-orders/${itemId}`;
|
|
65
66
|
}
|
|
66
67
|
if (query.type === "shift") {
|
|
@@ -85,6 +85,48 @@ describe("notifications/pdf-data", () => {
|
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
+
it("should return the proper data for order_confirmation (email template type)", () => {
|
|
89
|
+
const itemId = "12345";
|
|
90
|
+
const query = {
|
|
91
|
+
type: "order_confirmation"
|
|
92
|
+
};
|
|
93
|
+
axiosMock.onGet(`/pdf-orders/${itemId}`)
|
|
94
|
+
.reply(expectRequest({
|
|
95
|
+
statusCode: 200, token
|
|
96
|
+
}));
|
|
97
|
+
return api.notifications.pdfData.get({
|
|
98
|
+
token, query, itemId
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("should return the proper data for cancellation (email template type)", () => {
|
|
103
|
+
const itemId = "12345";
|
|
104
|
+
const query = {
|
|
105
|
+
type: "cancellation"
|
|
106
|
+
};
|
|
107
|
+
axiosMock.onGet(`/pdf-orders/${itemId}`)
|
|
108
|
+
.reply(expectRequest({
|
|
109
|
+
statusCode: 200, token
|
|
110
|
+
}));
|
|
111
|
+
return api.notifications.pdfData.get({
|
|
112
|
+
token, query, itemId
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should return the proper data for change (email template type)", () => {
|
|
117
|
+
const itemId = "12345";
|
|
118
|
+
const query = {
|
|
119
|
+
type: "change"
|
|
120
|
+
};
|
|
121
|
+
axiosMock.onGet(`/pdf-orders/${itemId}`)
|
|
122
|
+
.reply(expectRequest({
|
|
123
|
+
statusCode: 200, token
|
|
124
|
+
}));
|
|
125
|
+
return api.notifications.pdfData.get({
|
|
126
|
+
token, query, itemId
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
88
130
|
it("should return the proper data for a remainder slip", () => {
|
|
89
131
|
const itemId = "12345";
|
|
90
132
|
const query = {
|