diff --git a/src/collections/Files/hooks/beforeValidateCheckFileExists.ts b/src/collections/Files/hooks/beforeValidateCheckFileExists.ts index c848e90..ff1ba47 100644 --- a/src/collections/Files/hooks/beforeValidateCheckFileExists.ts +++ b/src/collections/Files/hooks/beforeValidateCheckFileExists.ts @@ -30,7 +30,7 @@ export const beforeValidateCheckFileExists: CollectionBeforeValidateHook = const url = generatePathForFile(type, filename); - const result = await fetch(url, { method: "HEAD" }); + const result = await fetch(url, { method: "head" }); if (result.status !== 200) { throw new Error(`Unable to locate the file at the following address: ${url}`); diff --git a/src/collections/Keys/endpoints/importFromStrapi.ts b/src/collections/Keys/endpoints/importFromStrapi.ts index 5fbac7a..e89f8a9 100644 --- a/src/collections/Keys/endpoints/importFromStrapi.ts +++ b/src/collections/Keys/endpoints/importFromStrapi.ts @@ -53,7 +53,7 @@ const importStrapiWordings: typeof importStrapiEntries = async ({ }; export const importFromStrapi: CollectionEndpoint = { - method: "get", + method: "post", path: "/strapi", handler: async (req, res) => { if (!req.user) { diff --git a/src/endpoints/createImageRegenerationEndpoint.ts b/src/endpoints/createImageRegenerationEndpoint.ts index d5fc17c..6ae427d 100644 --- a/src/endpoints/createImageRegenerationEndpoint.ts +++ b/src/endpoints/createImageRegenerationEndpoint.ts @@ -10,7 +10,7 @@ type Image = { }; export const createImageRegenerationEndpoint = (collection: Collections): CollectionEndpoint => ({ - method: "get", + method: "put", path: "/regenerate", handler: async (req, res) => { if (!mustBeAdmin(req)) { diff --git a/src/endpoints/createStrapiImportEndpoint.ts b/src/endpoints/createStrapiImportEndpoint.ts index ce896d9..c21e4e4 100644 --- a/src/endpoints/createStrapiImportEndpoint.ts +++ b/src/endpoints/createStrapiImportEndpoint.ts @@ -19,7 +19,7 @@ export const getAllStrapiEntries = async ( }); const uri = `${process.env.STRAPI_URI}/api/${collectionSlug}?${paramsWithPagination}`; const fetchResult = await fetch(uri, { - method: "GET", + method: "get", headers: { authorization: `Bearer ${process.env.STRAPI_TOKEN}` }, }); const { data, meta } = await fetchResult.json(); @@ -78,7 +78,7 @@ export const importStrapiEntries = async ({ }; export const createStrapiImportEndpoint = (params: Params): CollectionEndpoint => ({ - method: "get", + method: "post", path: "/strapi", handler: async (req, res) => { if (!req.user) {