Skip to content

Commit

Permalink
Fixes #36215 - Make arrays for TypeAhead mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren authored and adamruzicka committed Apr 6, 2023
1 parent 3a76de2 commit 4dbf9c8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Immutable from 'seamless-immutable';
import { STATUS } from 'foremanReact/constants';
import { deepPropsToCamelCase } from 'foremanReact/common/helpers';
import {
Expand Down Expand Up @@ -31,14 +32,12 @@ export const selectWebhookTemplates = state => {
if (selectTemplatesHasError(state) || selectTemplatesIsLoading(state))
return [];

return selectWebhookFormTemplatesResponse(state).results;
return Immutable.asMutable(selectWebhookFormTemplatesResponse(state).results);
};

// Webhook events selectors
const selectWebhookFormEventsResponse = state =>
deepPropsToCamelCase(
selectAPIResponse(state, WEBHOOK_EVENTS_API_REQUEST_KEY)
);
selectAPIResponse(state, WEBHOOK_EVENTS_API_REQUEST_KEY);

const selectWebhookFormEventsStatus = state =>
selectAPIStatus(state, WEBHOOK_EVENTS_API_REQUEST_KEY);
Expand All @@ -54,5 +53,5 @@ export const selectEventsIsLoading = state => {
export const selectWebhookEvents = state => {
if (selectEventsHasError(state) || selectEventsIsLoading(state)) return [];

return selectWebhookFormEventsResponse(state);
return Immutable.asMutable(selectWebhookFormEventsResponse(state));
};

0 comments on commit 4dbf9c8

Please sign in to comment.