Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36215 - Make arrays for TypeAhead mutable #56

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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));
};