parent
56b27b2e21
commit
fc0664885e
3 changed files with 13 additions and 3 deletions
5
.changeset/sour-deers-camp.md
Normal file
5
.changeset/sour-deers-camp.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"saleor-app-cms": patch
|
||||
---
|
||||
|
||||
CMS visual fixes
|
|
@ -121,7 +121,7 @@ export const providersConfig = {
|
|||
name: "itemTypeId",
|
||||
label: "Item Type ID (number)",
|
||||
helpText:
|
||||
'You can find this as Model ID in your DatoCMS product variant model settings, by clicking "Edit model".',
|
||||
"To find your Model ID go into Models -> Your product variant Model -> Edit Model button. The Model ID is in the right corner.",
|
||||
},
|
||||
{
|
||||
name: "baseUrl",
|
||||
|
|
|
@ -38,6 +38,7 @@ const handler: NextProtectedApiHandler = async (
|
|||
const logger = pinoLogger.child({
|
||||
endpoint: "sync-products-variants",
|
||||
});
|
||||
|
||||
logger.debug("Called endpoint sync-products-variants");
|
||||
|
||||
const client = createClient(authData.saleorApiUrl, async () => ({
|
||||
|
@ -95,8 +96,10 @@ const handler: NextProtectedApiHandler = async (
|
|||
logger.debug({ provider }, "The provider instance settings provider.");
|
||||
|
||||
if (!validation.success) {
|
||||
// todo: use instead: throw new Error(validation.error.message);
|
||||
// continue with other provider instances
|
||||
/*
|
||||
* todo: use instead: throw new Error(validation.error.message);
|
||||
* continue with other provider instances
|
||||
*/
|
||||
logger.error(
|
||||
{ error: validation.error.message },
|
||||
"The provider instance settings validation failed."
|
||||
|
@ -104,6 +107,7 @@ const handler: NextProtectedApiHandler = async (
|
|||
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
error: validation.error.message,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -129,6 +133,7 @@ const handler: NextProtectedApiHandler = async (
|
|||
const isAvailable = variantAvailableChannels?.some((channel) =>
|
||||
enabledChannelsForSelectedProviderInstance.includes(channel)
|
||||
);
|
||||
|
||||
return !!isAvailable;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue