hotfix: fulfillment-schema (#121)
* chore: debug * corrects fulfillment schema
This commit is contained in:
@@ -244,6 +244,10 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
* @return {Promise<object>} the result of the cancellation
|
||||
*/
|
||||
async cancelFulfillment(data) {
|
||||
if (Array.isArray(data)) {
|
||||
data = data[0]
|
||||
}
|
||||
|
||||
const order = await this.client_.orders.retrieve(data.id)
|
||||
|
||||
if (order.attributes.status !== "pending") {
|
||||
|
||||
@@ -4,7 +4,7 @@ export default new mongoose.Schema({
|
||||
created: { type: String, default: Date.now },
|
||||
provider_id: { type: String, required: true },
|
||||
items: { type: [mongoose.Schema.Types.Mixed], required: true },
|
||||
data: { type: [mongoose.Schema.Types.Mixed], default: {} },
|
||||
data: { type: mongoose.Schema.Types.Mixed, default: {} },
|
||||
tracking_numbers: { type: [String], default: [] },
|
||||
shipped_at: { type: String },
|
||||
is_canceled: { type: Boolean, default: false },
|
||||
|
||||
@@ -732,7 +732,7 @@ class OrderService extends BaseService {
|
||||
_id: orderId,
|
||||
},
|
||||
{
|
||||
$push: { fulfillments: { $each: results } },
|
||||
$addToSet: { fulfillments: { $each: results } },
|
||||
$set: updateFields,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user