asdfasdf
This commit is contained in:
@@ -30,6 +30,10 @@ const idParamSchema = Joi.object({
|
||||
id: Joi.number().integer().positive().required()
|
||||
});
|
||||
|
||||
const userProductIdParamSchema = Joi.object({
|
||||
userProductId: Joi.number().integer().positive().required()
|
||||
});
|
||||
|
||||
// @route GET /api/product-spreader-settings/product/:productId
|
||||
// @desc Get spreader settings for a specific product
|
||||
// @access Private
|
||||
@@ -66,7 +70,7 @@ router.get('/product/:productId', validateParams(idParamSchema), async (req, res
|
||||
// @route GET /api/product-spreader-settings/user-product/:userProductId
|
||||
// @desc Get spreader settings for a specific user product
|
||||
// @access Private
|
||||
router.get('/user-product/:userProductId', validateParams(idParamSchema), async (req, res, next) => {
|
||||
router.get('/user-product/:userProductId', validateParams(userProductIdParamSchema), async (req, res, next) => {
|
||||
try {
|
||||
const userProductId = req.params.userProductId;
|
||||
|
||||
|
||||
@@ -836,7 +836,12 @@ const EditProductModal = ({ product, onSubmit, onCancel, sharedProducts, categor
|
||||
});
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('Received spreader settings data:', data);
|
||||
setEditSpreaderSettings(data.data?.settings || []);
|
||||
} else {
|
||||
console.error('Failed to fetch spreader settings:', response.status, response.statusText);
|
||||
const errorText = await response.text();
|
||||
console.error('Error response body:', errorText);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load spreader settings:', error);
|
||||
|
||||
Reference in New Issue
Block a user