Implementação das ações incluir, atualizar e remover apontamentos de horas

This commit is contained in:
Paulo Porto
2026-05-05 01:27:07 -03:00
parent 4156b47506
commit a8e0e77aff
3 changed files with 899 additions and 41 deletions

View File

@@ -966,9 +966,14 @@ async function executeComcipFetch(tabId, requestUrl, method, payload, headers, r
headers: requestHeaders,
};
if (normalizedMethod !== "GET" && normalizedMethod !== "HEAD") {
if (
normalizedMethod !== "GET" &&
normalizedMethod !== "HEAD" &&
requestPayload !== undefined &&
requestPayload !== null
) {
requestHeaders["content-type"] = "application/json";
fetchOptions.body = JSON.stringify(requestPayload || {});
fetchOptions.body = JSON.stringify(requestPayload);
}
const response = await fetch(requestUrl, {
@@ -1130,9 +1135,14 @@ async function executeComcipFetchFromFrame(
headers: requestHeaders,
};
if (normalizedMethod !== "GET" && normalizedMethod !== "HEAD") {
if (
normalizedMethod !== "GET" &&
normalizedMethod !== "HEAD" &&
requestPayload !== undefined &&
requestPayload !== null
) {
requestHeaders["content-type"] = "application/json";
fetchOptions.body = JSON.stringify(requestPayload || {});
fetchOptions.body = JSON.stringify(requestPayload);
}
const response = await fetch(requestUrl, fetchOptions);
@@ -1264,9 +1274,14 @@ async function executeComcipDirectFetch(
headers: requestHeaders,
};
if (normalizedMethod !== "GET" && normalizedMethod !== "HEAD") {
if (
normalizedMethod !== "GET" &&
normalizedMethod !== "HEAD" &&
payload !== undefined &&
payload !== null
) {
requestHeaders["content-type"] = "application/json";
fetchOptions.body = JSON.stringify(payload || {});
fetchOptions.body = JSON.stringify(payload);
}
const response = await fetch(requestUrl, fetchOptions);