From 79cc9ad0856fdad151f260c3d712ff80800bcbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 3 May 2024 10:55:47 -0400 Subject: [PATCH] use upper case methods --- public/src/modules/api.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/src/modules/api.js b/public/src/modules/api.js index d0e7c2668060..fcee6b94b0c3 100644 --- a/public/src/modules/api.js +++ b/public/src/modules/api.js @@ -66,7 +66,7 @@ async function xhr(options) { const isJSON = contentType && contentType.startsWith('application/json'); let response; - if (options.method !== 'head') { + if (options.method !== 'HEAD') { if (isJSON) { response = await res.json(); } else { @@ -95,14 +95,14 @@ export function get(route, data, onSuccess) { export function head(route, data, onSuccess) { return call({ url: route + (data && Object.keys(data).length ? ('?' + $.param(data)) : ''), - method: 'head', + method: 'HEAD', }, onSuccess); } export function post(route, data, onSuccess) { return call({ url: route, - method: 'post', + method: 'POST', data, headers: { 'x-csrf-token': config.csrf_token, @@ -124,7 +124,7 @@ export function patch(route, data, onSuccess) { export function put(route, data, onSuccess) { return call({ url: route, - method: 'put', + method: 'PUT', data, headers: { 'x-csrf-token': config.csrf_token, @@ -135,7 +135,7 @@ export function put(route, data, onSuccess) { export function del(route, data, onSuccess) { return call({ url: route, - method: 'delete', + method: 'DELETE', data, headers: { 'x-csrf-token': config.csrf_token,