Project

General

Profile

Feature #26729

Add redux middleware for API calls

Added by Maria Agaphontzev about 1 year ago. Updated about 6 hours ago.


Description

https://community.theforeman.org/t/wip-proposal-refactoring-our-redux/11640
The goal is to create a new infrastructure for API communication that will make it easier to do API calls from redux controllers.
So we can create actions that will look like this:

  return {
    type: API_REQUEST,
    action: ACTIONS.GET,
    url: `/foreman_tasks/tasks/summary/${hours}`,
    subType: FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY,
    normalizeResponse: (data) => data.results[0],
    normalizeError: error => error.message,
    onError: error => console.log(error),
  }

Associated revisions

Revision 4c3432b9 (diff)
Added by magaphon 9 months ago

Fixes #26729 - add ajaxRequestActions middleware

Revision 3a5f2d45 (diff)
Added by Ron Lavi 7 months ago

Fixes #26729 - add intervals middleware

Revision 62a04395 (diff)
Added by Ron Lavi 5 months ago

Refs #26729 - refactor notifications polling

replace it by using the interval middleware

History

#1 Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/6739 added

#2 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing

#3 Updated by The Foreman Bot 12 months ago

  • Pull request https://github.com/theforeman/foreman/pull/6894 added

#4 Updated by The Foreman Bot 10 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7069 added

#5 Updated by The Foreman Bot 9 months ago

  • Fixed in Releases 1.24.0 added

#6 Updated by Anonymous 9 months ago

  • Status changed from Ready For Testing to Closed

#7 Updated by The Foreman Bot 9 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7121 added

#8 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7157 added

#9 Updated by The Foreman Bot 7 months ago

  • Fixed in Releases 2.0.0 added

#10 Updated by The Foreman Bot 7 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7228 added

#11 Updated by The Foreman Bot 5 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7207 added

#12 Updated by Jonathon Turel about 6 hours ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/7207)

Also available in: Atom PDF