Project

General

Profile

Actions

Task #600

open

User story #594: Board live search

Javascript method for Ajax POST request

Task #600: Javascript method for Ajax POST request

Added by Smith Paul 14 days ago. Updated 4 days ago.

Status:
In Progress
Priority:
Normal
Target version:
-
Start date:
10/16/2025
Due date:
10/24/2025 (Due in 14 days)
% Done:

0%

Estimated time:
14:00 h
Company custom field:
Deals:
Contacts:
Checklist custom field:
  • Define function signature and validate input
  • Implement fetch with JSON and CSRF
  • Add error handling and retry logic
  • Write unit tests for all cases
  • Document usage, examples, and types
Sprint:
Sprint #1 (Oct 04 - Oct 18)

Description

Build a reusable JavaScript method to perform an AJAX POST request using fetch, sending JSON payloads and handling CSRF tokens when required. The method should validate inputs, set correct headers, and serialize/deserialize JSON safely. It must implement robust error handling for non-2xx responses, network failures, and timeouts, returning a clear, Promise-based result. Include concise documentation and examples so it can be dropped into any project with minimal setup.

Updated by Smith Paul 4 days ago Actions #1

  • Checklist custom field deleted (Define the function signature (e.g., post(url, data, { headers, timeout })) and input validation)
  • Checklist custom field deleted (Implement fetch with Content-Type: application/json, JSON serialization, and CSRF token injection (if a meta tag or cookie exists))
  • Checklist custom field deleted (Add error handling: treat non-2xx as errors, parse JSON safely with fallback, implement AbortController timeout, and retry once on network errors)
  • Checklist custom field deleted (Write unit tests with mocked fetch for success, 4xx/5xx, invalid JSON, timeout, and retry logic; ensure coverage)
  • Checklist custom field deleted (Document usage and caveats (CORS, CSRF, timeouts), provide example calls, and ensure linter/TypeScript typings if applicable)
  • Checklist custom field Define function signature and validate input added
  • Checklist custom field Implement fetch with JSON and CSRF added
  • Checklist custom field Add error handling and retry logic added
  • Checklist custom field Write unit tests for all cases added
  • Checklist custom field Document usage, examples, and types added

Updated by Smith Paul 4 days ago Actions #2

  • Checklist custom field Implement fetch with JSON and CSRF set to Done

Updated by Smith Paul 2 days ago · Edited Actions #3

  • Tags set to frontend

Updated by Smith Paul 2 days ago · Edited Actions #4

  • Company custom field set to RedmineUP

Updated by Smith Paul 9 days ago · Edited Actions #5

  • Due date set to 12/24/2019
  • Start date changed from 12/20/2019 to 12/16/2019
  • Estimated time changed from 4:00 h to 14:00 h

Updated by Smith Paul 14 days ago · Edited Actions #6

  • Status changed from New to In Progress

Updated by Smith Paul 14 days ago · Edited Actions #7

  • Assignee set to Stone Elizabeth

Updated by Smith Paul 15 days ago · Edited Actions #8

  • Checklist custom field Define the function signature (e.g., post(url, data, { headers, timeout })) and input validation added
  • Checklist custom field Implement fetch with Content-Type: application/json, JSON serialization, and CSRF token injection (if a meta tag or cookie exists) added
  • Checklist custom field Add error handling: treat non-2xx as errors, parse JSON safely with fallback, implement AbortController timeout, and retry once on network errors added
  • Checklist custom field Write unit tests with mocked fetch for success, 4xx/5xx, invalid JSON, timeout, and retry logic; ensure coverage added
  • Checklist custom field Document usage and caveats (CORS, CSRF, timeouts), provide example calls, and ensure linter/TypeScript typings if applicable added
  • Description updated (diff)
Actions

Also available in: PDF Atom