Fixed product SKUs.
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
Some checks failed
farmcontrol/farmcontrol-api/pipeline/head There was a failure building this commit
This commit is contained in:
parent
bec68488a7
commit
fd636c6c82
@ -3,6 +3,7 @@ import { generateId } from '../../utils.js';
|
|||||||
const { Schema } = mongoose;
|
const { Schema } = mongoose;
|
||||||
|
|
||||||
const partSkuUsageSchema = new Schema({
|
const partSkuUsageSchema = new Schema({
|
||||||
|
part: { type: Schema.Types.ObjectId, ref: 'part', required: true },
|
||||||
partSku: { type: Schema.Types.ObjectId, ref: 'partSku', required: true },
|
partSku: { type: Schema.Types.ObjectId, ref: 'partSku', required: true },
|
||||||
quantity: { type: Number, required: true },
|
quantity: { type: Number, required: true },
|
||||||
});
|
});
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export const listProductSkusRouteHandler = async (
|
|||||||
search,
|
search,
|
||||||
sort,
|
sort,
|
||||||
order,
|
order,
|
||||||
populate: ['priceTaxRate', 'costTaxRate'],
|
populate: ['priceTaxRate', 'costTaxRate', 'product'],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result?.error) {
|
if (result?.error) {
|
||||||
@ -83,6 +83,8 @@ export const getProductSkuRouteHandler = async (req, res) => {
|
|||||||
'priceTaxRate',
|
'priceTaxRate',
|
||||||
'costTaxRate',
|
'costTaxRate',
|
||||||
'parts.partSku',
|
'parts.partSku',
|
||||||
|
'parts.part',
|
||||||
|
'product',
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
if (result?.error) {
|
if (result?.error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user