Add debug message for contentful - ping
This commit is contained in:
parent
7c9a9a2890
commit
99c307d1cb
2 changed files with 3 additions and 4 deletions
|
@ -96,7 +96,7 @@ const getEntryEndpoint = ({
|
|||
}): string => `/spaces/${spaceId}/environments/${environment}/entries/${resourceId}`;
|
||||
|
||||
const contentfulOperations: CreateOperations<ContentfulConfig> = (config) => {
|
||||
const logger = createLogger({ cms: "strapi" });
|
||||
const logger = createLogger({ cms: "contentful" });
|
||||
|
||||
const { environment, spaceId, contentId, locale, apiRequestsPerSecond } = config;
|
||||
|
||||
|
@ -105,8 +105,9 @@ const contentfulOperations: CreateOperations<ContentfulConfig> = (config) => {
|
|||
const pingCMS = async () => {
|
||||
const endpoint = `/spaces/${spaceId}`;
|
||||
const response = await contentfulFetch(endpoint, config, { method: "GET" });
|
||||
const respBody = await response.json();
|
||||
|
||||
logger.debug({ response }, "pingCMS response");
|
||||
logger.debug({ response, body: respBody }, "pingCMS response");
|
||||
return {
|
||||
ok: response.ok,
|
||||
};
|
||||
|
|
|
@ -14,7 +14,6 @@ export interface ProviderInstancePingApiPayload {
|
|||
|
||||
export interface ProviderInstancePingApiResponse {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
const handler: NextProtectedApiHandler = async (
|
||||
|
@ -73,7 +72,6 @@ const handler: NextProtectedApiHandler = async (
|
|||
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: JSON.stringify(e),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue