washday-sdk 0.0.149 → 0.0.150
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.
|
@@ -40,13 +40,16 @@ export const createProductSupply = function (id, data) {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
export const bulkCreate = function (data) {
|
|
43
|
+
export const bulkCreate = function (storeId, data) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
46
|
const config = {
|
|
47
|
-
headers: {
|
|
47
|
+
headers: {
|
|
48
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
49
|
+
'Content-Type': 'multipart/form-data' // Let axios handle the boundary
|
|
50
|
+
}
|
|
48
51
|
};
|
|
49
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${
|
|
52
|
+
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
50
53
|
return response.data || {};
|
|
51
54
|
}
|
|
52
55
|
catch (error) {
|
package/package.json
CHANGED
package/src/api/products/post.ts
CHANGED
|
@@ -53,16 +53,15 @@ export const createProductSupply = async function (this: WashdayClientInstance,
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export const bulkCreate = async function (this: WashdayClientInstance, data: {
|
|
57
|
-
section: string;
|
|
58
|
-
store: string;
|
|
59
|
-
csvFile: any;
|
|
60
|
-
}): Promise<any> {
|
|
56
|
+
export const bulkCreate = async function (this: WashdayClientInstance, storeId: string, data: FormData): Promise<any> {
|
|
61
57
|
try {
|
|
62
58
|
const config = {
|
|
63
|
-
headers: {
|
|
59
|
+
headers: {
|
|
60
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
61
|
+
'Content-Type': 'multipart/form-data' // Let axios handle the boundary
|
|
62
|
+
}
|
|
64
63
|
};
|
|
65
|
-
const response = await axiosInstance.post(`${GET_SET_PRODUCTS}/${
|
|
64
|
+
const response = await axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
66
65
|
return response.data || {};
|
|
67
66
|
} catch (error) {
|
|
68
67
|
console.error('Error fetching products bulkCreate:', error);
|